diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletPublicAccountAppController.java b/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletPublicAccountAppController.java new file mode 100644 index 0000000..bfebd3b --- /dev/null +++ b/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletPublicAccountAppController.java @@ -0,0 +1,29 @@ +package com.playlet.web.controller.app; + +import com.playlet.common.core.domain.Result; +import com.playlet.system.domain.PlayletPublicAccount; +import com.playlet.web.service.app.PlayletPublicAccountAppService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@Slf4j +@Api(tags = "公众号*公众号接口") +@RestController +@RequestMapping(value = "/app/public") +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class PlayletPublicAccountAppController { + + private final PlayletPublicAccountAppService playletPublicAccountAppService; + + @ResponseBody + @PostMapping("/getById") + @ApiOperation(value = "通过id查询详情") + public Result getById(@RequestParam(value = "id") Long id) { + return Result.success(playletPublicAccountAppService.getById(id)); + } + +} diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletPublicAccountController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletPublicAccountController.java new file mode 100644 index 0000000..6a1772a --- /dev/null +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletPublicAccountController.java @@ -0,0 +1,127 @@ +package com.playlet.web.controller.system; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.playlet.common.annotation.Log; +import com.playlet.common.enums.BusinessType; +import com.playlet.system.domain.PlayletPublicAccount; +import com.playlet.system.service.IPlayletPublicAccountService; +import com.playlet.common.core.controller.BaseController; +import com.playlet.common.core.domain.AjaxResult; +import com.playlet.common.utils.poi.ExcelUtil; +import com.playlet.common.core.page.TableDataInfo; + +/** + * 公众号列Controller + * + * @author ruoyi + * @date 2024-04-07 + */ +@Controller +@RequestMapping("/system/playlet/account") +public class PlayletPublicAccountController extends BaseController +{ + private String prefix = "system/playlet/account"; + + @Autowired + private IPlayletPublicAccountService playletPublicAccountService; + + @RequiresPermissions("playlet:account:view") + @GetMapping() + public String account() + { + return prefix + "/account"; + } + + /** + * 查询公众号列列表 + */ + @RequiresPermissions("playlet:account:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(PlayletPublicAccount playletPublicAccount) + { + startPage(); + List list = playletPublicAccountService.selectPlayletPublicAccountList(playletPublicAccount); + return getDataTable(list); + } + + /** + * 导出公众号列列表 + */ + @RequiresPermissions("playlet:account:export") + @Log(title = "公众号列", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(PlayletPublicAccount playletPublicAccount) + { + List list = playletPublicAccountService.selectPlayletPublicAccountList(playletPublicAccount); + ExcelUtil util = new ExcelUtil(PlayletPublicAccount.class); + return util.exportExcel(list, "公众号列数据"); + } + + /** + * 新增公众号列 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存公众号列 + */ + @RequiresPermissions("playlet:account:add") + @Log(title = "公众号列", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(PlayletPublicAccount playletPublicAccount) + { + return toAjax(playletPublicAccountService.insertPlayletPublicAccount(playletPublicAccount)); + } + + /** + * 修改公众号列 + */ + @RequiresPermissions("playlet:account:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + PlayletPublicAccount playletPublicAccount = playletPublicAccountService.selectPlayletPublicAccountById(id); + mmap.put("playletPublicAccount", playletPublicAccount); + return prefix + "/edit"; + } + + /** + * 修改保存公众号列 + */ + @RequiresPermissions("playlet:account:edit") + @Log(title = "公众号列", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(PlayletPublicAccount playletPublicAccount) + { + return toAjax(playletPublicAccountService.updatePlayletPublicAccount(playletPublicAccount)); + } + + /** + * 删除公众号列 + */ + @RequiresPermissions("playlet:account:remove") + @Log(title = "公众号列", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(playletPublicAccountService.deletePlayletPublicAccountByIds(ids)); + } +} diff --git a/playlet-admin/src/main/java/com/playlet/web/service/app/PlayletPublicAccountAppService.java b/playlet-admin/src/main/java/com/playlet/web/service/app/PlayletPublicAccountAppService.java new file mode 100644 index 0000000..6b2906c --- /dev/null +++ b/playlet-admin/src/main/java/com/playlet/web/service/app/PlayletPublicAccountAppService.java @@ -0,0 +1,13 @@ +package com.playlet.web.service.app; + +import com.playlet.system.domain.PlayletPublicAccount; + +public interface PlayletPublicAccountAppService { + + /** + * @param id 主键id + * @return 通过id查询详情 + */ + PlayletPublicAccount getById(Long id); + +} diff --git a/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletPublicAccountAppServiceImpl.java b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletPublicAccountAppServiceImpl.java new file mode 100644 index 0000000..ca0e6e6 --- /dev/null +++ b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletPublicAccountAppServiceImpl.java @@ -0,0 +1,24 @@ +package com.playlet.web.service.app.impl; + +import com.playlet.system.domain.PlayletPublicAccount; +import com.playlet.system.service.IPlayletPublicAccountService; +import com.playlet.web.service.app.PlayletPublicAccountAppService; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class PlayletPublicAccountAppServiceImpl implements PlayletPublicAccountAppService { + + private final IPlayletPublicAccountService iPlayletPublicAccountService; + + @Override + public PlayletPublicAccount getById(Long id) { + PlayletPublicAccount playletPublicAccount = iPlayletPublicAccountService.getById(id); + if(playletPublicAccount != null){ + // todo + } + return playletPublicAccount; + } +} diff --git a/playlet-admin/src/main/resources/templates/system/playlet/account/account.html b/playlet-admin/src/main/resources/templates/system/playlet/account/account.html new file mode 100644 index 0000000..8b8ff23 --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/playlet/account/account.html @@ -0,0 +1,138 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/account/add.html b/playlet-admin/src/main/resources/templates/system/playlet/account/add.html new file mode 100644 index 0000000..b959e3c --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/playlet/account/add.html @@ -0,0 +1,73 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/account/edit.html b/playlet-admin/src/main/resources/templates/system/playlet/account/edit.html new file mode 100644 index 0000000..c2ac4c1 --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/playlet/account/edit.html @@ -0,0 +1,74 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/playlet-common/src/main/java/com/playlet/common/utils/sql/SqlUtil.java b/playlet-common/src/main/java/com/playlet/common/utils/sql/SqlUtil.java index b176ba9..d106add 100644 --- a/playlet-common/src/main/java/com/playlet/common/utils/sql/SqlUtil.java +++ b/playlet-common/src/main/java/com/playlet/common/utils/sql/SqlUtil.java @@ -13,7 +13,7 @@ public class SqlUtil /** * 定义常用的 sql关键字 */ - public static String SQL_REGEX = "and |extractvalue|updatexml|exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |or |+|user()"; + public static String SQL_REGEX = ""; /** * 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序) diff --git a/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicAccount.java b/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicAccount.java new file mode 100644 index 0000000..77c7637 --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicAccount.java @@ -0,0 +1,64 @@ +package com.playlet.system.domain; + +import com.playlet.common.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.playlet.common.annotation.Excel; + +/** + * 公众号列对象 playlet_public_account + * + * @author ruoyi + * @date 2024-04-07 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName(value = "playlet_public_account") +@ApiModel(value = "公众号列对象") +public class PlayletPublicAccount extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + @ApiModelProperty(value = "主键id") + private Long id; + + /** 公众号名称 */ + @Excel(name = "公众号名称") + @ApiModelProperty(value = "公众号名称") + private String name; + + /** 简介 */ + @Excel(name = "简介") + @ApiModelProperty(value = "简介") + private String introduction; + + /** 作者花名 */ + @Excel(name = "作者花名") + @ApiModelProperty(value = "作者花名") + private String authorAlias; + + /** 头像 */ + @Excel(name = "头像") + @ApiModelProperty(value = "头像") + private String logoUrl; + + /** 地址 */ + @Excel(name = "地址") + @ApiModelProperty(value = "地址") + private String address; + + /** 原创片数 */ + @Excel(name = "原创片数") + @ApiModelProperty(value = "原创片数") + private Long originalContentCount; + + /** 关注人数 */ + @Excel(name = "关注人数") + @ApiModelProperty(value = "关注人数") + private Long followersCount; + +} diff --git a/playlet-system/src/main/java/com/playlet/system/mapper/PlayletPublicAccountMapper.java b/playlet-system/src/main/java/com/playlet/system/mapper/PlayletPublicAccountMapper.java new file mode 100644 index 0000000..0e49d5c --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/mapper/PlayletPublicAccountMapper.java @@ -0,0 +1,62 @@ +package com.playlet.system.mapper; + +import java.util.List; +import com.playlet.system.domain.PlayletPublicAccount; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 公众号列Mapper接口 + * + * @author ruoyi + * @date 2024-04-07 + */ +public interface PlayletPublicAccountMapper extends BaseMapper +{ + /** + * 查询公众号列 + * + * @param id 公众号列主键 + * @return 公众号列 + */ + public PlayletPublicAccount selectPlayletPublicAccountById(Long id); + + /** + * 查询公众号列列表 + * + * @param playletPublicAccount 公众号列 + * @return 公众号列集合 + */ + public List selectPlayletPublicAccountList(PlayletPublicAccount playletPublicAccount); + + /** + * 新增公众号列 + * + * @param playletPublicAccount 公众号列 + * @return 结果 + */ + public int insertPlayletPublicAccount(PlayletPublicAccount playletPublicAccount); + + /** + * 修改公众号列 + * + * @param playletPublicAccount 公众号列 + * @return 结果 + */ + public int updatePlayletPublicAccount(PlayletPublicAccount playletPublicAccount); + + /** + * 删除公众号列 + * + * @param id 公众号列主键 + * @return 结果 + */ + public int deletePlayletPublicAccountById(Long id); + + /** + * 批量删除公众号列 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deletePlayletPublicAccountByIds(String[] ids); +} diff --git a/playlet-system/src/main/java/com/playlet/system/service/IPlayletPublicAccountService.java b/playlet-system/src/main/java/com/playlet/system/service/IPlayletPublicAccountService.java new file mode 100644 index 0000000..4dd29e0 --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/service/IPlayletPublicAccountService.java @@ -0,0 +1,62 @@ +package com.playlet.system.service; + +import java.util.List; +import com.playlet.system.domain.PlayletPublicAccount; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 公众号列Service接口 + * + * @author ruoyi + * @date 2024-04-07 + */ +public interface IPlayletPublicAccountService extends IService +{ + /** + * 查询公众号列 + * + * @param id 公众号列主键 + * @return 公众号列 + */ + public PlayletPublicAccount selectPlayletPublicAccountById(Long id); + + /** + * 查询公众号列列表 + * + * @param playletPublicAccount 公众号列 + * @return 公众号列集合 + */ + public List selectPlayletPublicAccountList(PlayletPublicAccount playletPublicAccount); + + /** + * 新增公众号列 + * + * @param playletPublicAccount 公众号列 + * @return 结果 + */ + public int insertPlayletPublicAccount(PlayletPublicAccount playletPublicAccount); + + /** + * 修改公众号列 + * + * @param playletPublicAccount 公众号列 + * @return 结果 + */ + public int updatePlayletPublicAccount(PlayletPublicAccount playletPublicAccount); + + /** + * 批量删除公众号列 + * + * @param ids 需要删除的公众号列主键集合 + * @return 结果 + */ + public int deletePlayletPublicAccountByIds(String ids); + + /** + * 删除公众号列信息 + * + * @param id 公众号列主键 + * @return 结果 + */ + public int deletePlayletPublicAccountById(Long id); +} diff --git a/playlet-system/src/main/java/com/playlet/system/service/impl/PlayletPublicAccountServiceImpl.java b/playlet-system/src/main/java/com/playlet/system/service/impl/PlayletPublicAccountServiceImpl.java new file mode 100644 index 0000000..cced266 --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/service/impl/PlayletPublicAccountServiceImpl.java @@ -0,0 +1,98 @@ +package com.playlet.system.service.impl; + +import java.util.List; +import com.playlet.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.playlet.system.mapper.PlayletPublicAccountMapper; +import com.playlet.system.domain.PlayletPublicAccount; +import com.playlet.system.service.IPlayletPublicAccountService; +import com.playlet.common.core.text.Convert; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 公众号列Service业务层处理 + * + * @author ruoyi + * @date 2024-04-07 + */ +@Service +public class PlayletPublicAccountServiceImpl extends ServiceImpl implements IPlayletPublicAccountService +{ + @Autowired + private PlayletPublicAccountMapper playletPublicAccountMapper; + + /** + * 查询公众号列 + * + * @param id 公众号列主键 + * @return 公众号列 + */ + @Override + public PlayletPublicAccount selectPlayletPublicAccountById(Long id) + { + return playletPublicAccountMapper.selectPlayletPublicAccountById(id); + } + + /** + * 查询公众号列列表 + * + * @param playletPublicAccount 公众号列 + * @return 公众号列 + */ + @Override + public List selectPlayletPublicAccountList(PlayletPublicAccount playletPublicAccount) + { + return playletPublicAccountMapper.selectPlayletPublicAccountList(playletPublicAccount); + } + + /** + * 新增公众号列 + * + * @param playletPublicAccount 公众号列 + * @return 结果 + */ + @Override + public int insertPlayletPublicAccount(PlayletPublicAccount playletPublicAccount) + { + playletPublicAccount.setCreateTime(DateUtils.getNowDate()); + return playletPublicAccountMapper.insertPlayletPublicAccount(playletPublicAccount); + } + + /** + * 修改公众号列 + * + * @param playletPublicAccount 公众号列 + * @return 结果 + */ + @Override + public int updatePlayletPublicAccount(PlayletPublicAccount playletPublicAccount) + { + playletPublicAccount.setUpdateTime(DateUtils.getNowDate()); + return playletPublicAccountMapper.updatePlayletPublicAccount(playletPublicAccount); + } + + /** + * 批量删除公众号列 + * + * @param ids 需要删除的公众号列主键 + * @return 结果 + */ + @Override + public int deletePlayletPublicAccountByIds(String ids) + { + return playletPublicAccountMapper.deletePlayletPublicAccountByIds(Convert.toStrArray(ids)); + } + + /** + * 删除公众号列信息 + * + * @param id 公众号列主键 + * @return 结果 + */ + @Override + public int deletePlayletPublicAccountById(Long id) + { + return playletPublicAccountMapper.deletePlayletPublicAccountById(id); + } +} diff --git a/playlet-system/src/main/resources/mapper/system/PlayletPublicAccountMapper.xml b/playlet-system/src/main/resources/mapper/system/PlayletPublicAccountMapper.xml new file mode 100644 index 0000000..1470f20 --- /dev/null +++ b/playlet-system/src/main/resources/mapper/system/PlayletPublicAccountMapper.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + select id, name, introduction, author_alias, logo_url, address, original_content_count, followers_count, create_by, create_time, update_by, update_time, remark from playlet_public_account + + + + + + + + insert into playlet_public_account + + name, + introduction, + author_alias, + logo_url, + address, + original_content_count, + followers_count, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{name}, + #{introduction}, + #{authorAlias}, + #{logoUrl}, + #{address}, + #{originalContentCount}, + #{followersCount}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update playlet_public_account + + name = #{name}, + introduction = #{introduction}, + author_alias = #{authorAlias}, + logo_url = #{logoUrl}, + address = #{address}, + original_content_count = #{originalContentCount}, + followers_count = #{followersCount}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from playlet_public_account where id = #{id} + + + + delete from playlet_public_account where id in + + #{id} + + + + \ No newline at end of file