1. 手动合并存在重复被合并的文件,并统一包名
This commit is contained in:
19
zt-module-mp/zt-module-mp-server/Dockerfile
Normal file
19
zt-module-mp/zt-module-mp-server/Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
||||
## AdoptOpenJDK 停止发布 OpenJDK 二进制,而 Eclipse Temurin 是它的延伸,提供更好的稳定性
|
||||
## 感谢复旦核博士的建议!灰子哥,牛皮!
|
||||
FROM eclipse-temurin:21-jre
|
||||
|
||||
## 创建目录,并使用它作为工作目录
|
||||
RUN mkdir -p /zt-module-mp-server
|
||||
WORKDIR /zt-module-mp-server
|
||||
## 将后端项目的 Jar 文件,复制到镜像中
|
||||
COPY ./target/zt-module-mp-server.jar app.jar
|
||||
|
||||
## 设置 TZ 时区
|
||||
## 设置 JAVA_OPTS 环境变量,可通过 docker run -e "JAVA_OPTS=" 进行覆盖
|
||||
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms512m -Xmx512m"
|
||||
|
||||
## 暴露后端项目的 48080 端口
|
||||
EXPOSE 48086
|
||||
|
||||
## 启动后端项目
|
||||
CMD java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar app.jar
|
||||
136
zt-module-mp/zt-module-mp-server/pom.xml
Normal file
136
zt-module-mp/zt-module-mp-server/pom.xml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
||||
package com.zt.plat.module.mp;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 项目的启动类
|
||||
*
|
||||
* 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
||||
* 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
||||
* 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class MpServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
||||
|
||||
SpringApplication.run(MpServerApplication.class, args);
|
||||
|
||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
||||
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.zt.plat.module.mp.controller.admin.account;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.mp.controller.admin.account.vo.*;
|
||||
import com.zt.plat.module.mp.convert.account.MpAccountConvert;
|
||||
import com.zt.plat.module.mp.dal.dataobject.account.MpAccountDO;
|
||||
import com.zt.plat.module.mp.service.account.MpAccountService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 公众号账号")
|
||||
@RestController
|
||||
@RequestMapping("/mp/account")
|
||||
@Validated
|
||||
public class MpAccountController {
|
||||
|
||||
@Resource
|
||||
private MpAccountService mpAccountService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建公众号账号")
|
||||
@PreAuthorize("@ss.hasPermission('mp:account:create')")
|
||||
public CommonResult<Long> createAccount(@Valid @RequestBody MpAccountCreateReqVO createReqVO) {
|
||||
return success(mpAccountService.createAccount(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新公众号账号")
|
||||
@PreAuthorize("@ss.hasPermission('mp:account:update')")
|
||||
public CommonResult<Boolean> updateAccount(@Valid @RequestBody MpAccountUpdateReqVO updateReqVO) {
|
||||
mpAccountService.updateAccount(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除公众号账号")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('mp:account:delete')")
|
||||
public CommonResult<Boolean> deleteAccount(@RequestParam("id") Long id) {
|
||||
mpAccountService.deleteAccount(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得公众号账号")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mp:account:query')")
|
||||
public CommonResult<MpAccountRespVO> getAccount(@RequestParam("id") Long id) {
|
||||
MpAccountDO wxAccount = mpAccountService.getAccount(id);
|
||||
return success(MpAccountConvert.INSTANCE.convert(wxAccount));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得公众号账号分页")
|
||||
@PreAuthorize("@ss.hasPermission('mp:account:query')")
|
||||
public CommonResult<PageResult<MpAccountRespVO>> getAccountPage(@Valid MpAccountPageReqVO pageVO) {
|
||||
PageResult<MpAccountDO> pageResult = mpAccountService.getAccountPage(pageVO);
|
||||
return success(MpAccountConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/list-all-simple")
|
||||
@Operation(summary = "获取公众号账号精简信息列表")
|
||||
@PreAuthorize("@ss.hasPermission('mp:account:query')")
|
||||
public CommonResult<List<MpAccountSimpleRespVO>> getSimpleAccounts() {
|
||||
List<MpAccountDO> list = mpAccountService.getAccountList();
|
||||
return success(MpAccountConvert.INSTANCE.convertList02(list));
|
||||
}
|
||||
|
||||
@PutMapping("/generate-qr-code")
|
||||
@Operation(summary = "生成公众号二维码")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('mp:account:qr-code')")
|
||||
public CommonResult<Boolean> generateAccountQrCode(@RequestParam("id") Long id) {
|
||||
mpAccountService.generateAccountQrCode(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/clear-quota")
|
||||
@Operation(summary = "清空公众号 API 配额")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('mp:account:clear-quota')")
|
||||
public CommonResult<Boolean> clearAccountQuota(@RequestParam("id") Long id) {
|
||||
mpAccountService.clearAccountQuota(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.zt.plat.module.mp.controller.admin.account.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 公众号账号 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*
|
||||
* @author fengdan
|
||||
*/
|
||||
@Data
|
||||
public class MpAccountBaseVO {
|
||||
|
||||
@Schema(description = "公众号名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道源码")
|
||||
@NotEmpty(message = "公众号名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "公众号微信号", requiredMode = Schema.RequiredMode.REQUIRED, example = "ztyuanma")
|
||||
@NotEmpty(message = "公众号微信号不能为空")
|
||||
private String account;
|
||||
|
||||
@Schema(description = "公众号 appId", requiredMode = Schema.RequiredMode.REQUIRED, example = "wx5b23ba7a5589ecbb")
|
||||
@NotEmpty(message = "公众号 appId 不能为空")
|
||||
private String appId;
|
||||
|
||||
@Schema(description = "公众号密钥", requiredMode = Schema.RequiredMode.REQUIRED, example = "3a7b3b20c537e52e74afd395eb85f61f")
|
||||
@NotEmpty(message = "公众号密钥不能为空")
|
||||
private String appSecret;
|
||||
|
||||
@Schema(description = "公众号 token", requiredMode = Schema.RequiredMode.REQUIRED, example = "kangdayuzhen")
|
||||
@NotEmpty(message = "公众号 token 不能为空")
|
||||
private String token;
|
||||
|
||||
@Schema(description = "加密密钥", example = "gjN+Ksei")
|
||||
private String aesKey;
|
||||
|
||||
@Schema(description = "备注", example = "请关注芋道源码,学习技术")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.zt.plat.module.mp.controller.admin.account.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 公众号账号创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MpAccountCreateReqVO extends MpAccountBaseVO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zt.plat.module.mp.controller.admin.account.vo;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 公众号账号分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MpAccountPageReqVO extends PageParam {
|
||||
|
||||
@Schema(name = "公众号名称", description = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@Schema(name = "公众号账号", description = "模糊匹配")
|
||||
private String account;
|
||||
|
||||
@Schema(name = "公众号 appid", description = "模糊匹配")
|
||||
private String appId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.zt.plat.module.mp.controller.admin.account.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 公众号账号 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MpAccountRespVO extends MpAccountBaseVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "二维码图片URL", example = "https://www.iocoder.cn/1024.png")
|
||||
private String qrCodeUrl;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zt.plat.module.mp.controller.admin.account.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 公众号账号精简信息 Response VO")
|
||||
@Data
|
||||
public class MpAccountSimpleRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "公众号名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道源码")
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.zt.plat.module.mp.controller.admin.account.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 公众号账号更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MpAccountUpdateReqVO extends MpAccountBaseVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user