mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-25 00:15:06 +08:00
fix(公众号账号管理): 增、删、改、查
This commit is contained in:
@ -25,10 +25,12 @@ import java.util.List;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
// TODO @亚洲:/mp/account 即可
|
||||
/**
|
||||
* @author fengdan
|
||||
*/
|
||||
@Api(tags = "管理后台 - 公众号账户")
|
||||
@RestController
|
||||
@RequestMapping("/wechatMp/wx-account")
|
||||
@RequestMapping("/wechatMp/account")
|
||||
@Validated
|
||||
public class WxAccountController {
|
||||
|
||||
@ -37,14 +39,14 @@ public class WxAccountController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建公众号账户")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account:create')")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:account:create')")
|
||||
public CommonResult<Long> createWxAccount(@Valid @RequestBody WxAccountCreateReqVO createReqVO) {
|
||||
return success(wxAccountService.createWxAccount(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新公众号账户")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account:update')")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:account:update')")
|
||||
public CommonResult<Boolean> updateWxAccount(@Valid @RequestBody WxAccountUpdateReqVO updateReqVO) {
|
||||
wxAccountService.updateWxAccount(updateReqVO);
|
||||
return success(true);
|
||||
@ -53,7 +55,7 @@ public class WxAccountController {
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除公众号账户")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account:delete')")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:account:delete')")
|
||||
public CommonResult<Boolean> deleteWxAccount(@RequestParam("id") Long id) {
|
||||
wxAccountService.deleteWxAccount(id);
|
||||
return success(true);
|
||||
@ -62,7 +64,7 @@ public class WxAccountController {
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得公众号账户")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account:query')")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:account:query')")
|
||||
public CommonResult<WxAccountRespVO> getWxAccount(@RequestParam("id") Long id) {
|
||||
WxAccountDO wxAccount = wxAccountService.getWxAccount(id);
|
||||
return success(WxAccountConvert.INSTANCE.convert(wxAccount));
|
||||
@ -71,7 +73,7 @@ public class WxAccountController {
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得公众号账户列表")
|
||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account:query')")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:account:query')")
|
||||
public CommonResult<List<WxAccountRespVO>> getWxAccountList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<WxAccountDO> list = wxAccountService.getWxAccountList(ids);
|
||||
return success(WxAccountConvert.INSTANCE.convertList(list));
|
||||
@ -79,7 +81,7 @@ public class WxAccountController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得公众号账户分页")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account:query')")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:account:query')")
|
||||
public CommonResult<PageResult<WxAccountRespVO>> getWxAccountPage(@Valid WxAccountPageReqVO pageVO) {
|
||||
PageResult<WxAccountDO> pageResult = wxAccountService.getWxAccountPage(pageVO);
|
||||
return success(WxAccountConvert.INSTANCE.convertPage(pageResult));
|
||||
@ -87,7 +89,7 @@ public class WxAccountController {
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出公众号账户 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account:export')")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:account:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportWxAccountExcel(@Valid WxAccountExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
|
@ -1,32 +1,40 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 公众号账户 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
* 公众号账户 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*
|
||||
* @author fengdan
|
||||
*/
|
||||
@Data
|
||||
public class WxAccountBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "公众号名称")
|
||||
@ApiModelProperty(value = "公众号名称", required = true)
|
||||
@NotNull(message = "公众号名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "公众号账户")
|
||||
@ApiModelProperty(value = "公众号账户", required = true)
|
||||
@NotNull(message = "公众号账户不能为空")
|
||||
private String account;
|
||||
|
||||
@ApiModelProperty(value = "公众号appid")
|
||||
private String appid;
|
||||
@ApiModelProperty(value = "公众号appid", required = true)
|
||||
@NotNull(message = "公众号appid不能为空")
|
||||
private String appId;
|
||||
|
||||
@ApiModelProperty(value = "公众号密钥")
|
||||
private String appsecret;
|
||||
@ApiModelProperty(value = "公众号密钥", required = true)
|
||||
@NotNull(message = "公众号密钥不能为空")
|
||||
private String appSecret;
|
||||
|
||||
@ApiModelProperty(value = "公众号token")
|
||||
private String token;
|
||||
|
||||
@ApiModelProperty(value = "加密密钥")
|
||||
private String aeskey;
|
||||
private String aesKey;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
@ -1,8 +1,13 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @author fengdan
|
||||
*/
|
||||
@ApiModel("管理后台 - 公众号账户创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
@ -1,9 +1,10 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 公众号账户 Excel VO
|
||||
@ -23,10 +24,7 @@ public class WxAccountExcelVO {
|
||||
private String account;
|
||||
|
||||
@ExcelProperty("公众号appid")
|
||||
private String appid;
|
||||
|
||||
@ExcelProperty("公众号密钥")
|
||||
private String appsecret;
|
||||
private String appId;
|
||||
|
||||
@ExcelProperty("公众号url")
|
||||
private String url;
|
||||
@ -35,7 +33,7 @@ public class WxAccountExcelVO {
|
||||
private String token;
|
||||
|
||||
@ExcelProperty("加密密钥")
|
||||
private String aeskey;
|
||||
private String aesKey;
|
||||
|
||||
@ExcelProperty("二维码图片URL")
|
||||
private String qrCodeUrl;
|
||||
@ -45,5 +43,4 @@ public class WxAccountExcelVO {
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,9 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
/**
|
||||
* @author fengdan
|
||||
*/
|
||||
@ApiModel(value = "管理后台 - 公众号账户 Excel 导出 Request VO", description = "参数和 WxAccountPageReqVO 是一致的")
|
||||
@Data
|
||||
public class WxAccountExportReqVO {
|
||||
@ -18,7 +21,7 @@ public class WxAccountExportReqVO {
|
||||
private String account;
|
||||
|
||||
@ApiModelProperty(value = "公众号appid")
|
||||
private String appid;
|
||||
private String appId;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "开始创建时间")
|
||||
|
@ -8,12 +8,14 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
/**
|
||||
* @author fengdan
|
||||
*/
|
||||
@ApiModel("管理后台 - 公众号账户分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class WxAccountPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "公众号名称")
|
||||
private String name;
|
||||
|
||||
@ -21,7 +23,7 @@ public class WxAccountPageReqVO extends PageParam {
|
||||
private String account;
|
||||
|
||||
@ApiModelProperty(value = "公众号appid")
|
||||
private String appid;
|
||||
private String appId;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "开始创建时间")
|
||||
@ -30,5 +32,4 @@ public class WxAccountPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "结束创建时间")
|
||||
private Date endCreateTime;
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,16 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author fengdan
|
||||
*/
|
||||
@ApiModel("管理后台 - 公众号账户 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ -22,4 +29,6 @@ public class WxAccountRespVO extends WxAccountBaseVO {
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "公众号密钥", required = true)
|
||||
private String appSecret;
|
||||
}
|
||||
|
@ -4,6 +4,9 @@ import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* @author fengdan
|
||||
*/
|
||||
@ApiModel("管理后台 - 公众号账户更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
@ -22,7 +22,7 @@ public interface WxAccountMapper extends BaseMapperX<WxAccountDO> {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<WxAccountDO>()
|
||||
.likeIfPresent(WxAccountDO::getName, reqVO.getName())
|
||||
.eqIfPresent(WxAccountDO::getAccount, reqVO.getAccount())
|
||||
.eqIfPresent(WxAccountDO::getAppId, reqVO.getAppid())
|
||||
.eqIfPresent(WxAccountDO::getAppId, reqVO.getAppId())
|
||||
.betweenIfPresent(WxAccountDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
||||
.orderByDesc(WxAccountDO::getId));
|
||||
}
|
||||
@ -31,7 +31,7 @@ public interface WxAccountMapper extends BaseMapperX<WxAccountDO> {
|
||||
return selectList(new LambdaQueryWrapperX<WxAccountDO>()
|
||||
.likeIfPresent(WxAccountDO::getName, reqVO.getName())
|
||||
.eqIfPresent(WxAccountDO::getAccount, reqVO.getAccount())
|
||||
.eqIfPresent(WxAccountDO::getAppId, reqVO.getAppid())
|
||||
.eqIfPresent(WxAccountDO::getAppId, reqVO.getAppId())
|
||||
.betweenIfPresent(WxAccountDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
||||
.orderByDesc(WxAccountDO::getId));
|
||||
}
|
||||
|
Reference in New Issue
Block a user