From 98acf286ab5d7095e2309cb9bd47d5f1eda3b227 Mon Sep 17 00:00:00 2001 From: bai <173792339@qq.com> Date: Fri, 30 Aug 2024 09:06:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=BA=932?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 32 ++++ Dockerfile | 16 ++ cloud-market2-client/pom.xml | 28 ++++ .../src/main/java/com/muyu/Main.java | 8 + cloud-market2-common/pom.xml | 26 +++ .../src/main/java/com/muyu/Main.java | 8 + .../java/com/muyu/market/admain/Myapi.java | 119 ++++++++++++++ .../com/muyu/market/admain/SelectByPhone.java | 18 ++ .../com/muyu/market/admain/SelectWeather.java | 37 +++++ .../com/muyu/market/admain/SysLogininfor.java | 56 +++++++ .../java/com/muyu/market/admain/SysUser.java | 130 +++++++++++++++ .../market/admain/request/MyapiListReq.java | 75 +++++++++ .../market/admain/request/MyapiSaveReq.java | 78 +++++++++ .../market/admain/request/MyapiUpdReq.java | 76 +++++++++ .../admain/request/updUserMoneyReq.java | 127 +++++++++++++++ .../market/admain/response/MyapiListResp.java | 97 +++++++++++ .../market/admain/response/MyapiSaveResp.java | 84 ++++++++++ .../admain/response/SysLogininforResp.java | 56 +++++++ .../admain/response/updSysUserMoneyResp.java | 126 ++++++++++++++ cloud-market2-remote/pom.xml | 27 +++ .../src/main/java/com/muyu/Main.java | 8 + cloud-market2-server/pom.xml | 151 +++++++++++++++++ .../muyu/market/server/MarketApplication.java | 17 ++ .../server/controller/MyapiController.java | 103 ++++++++++++ .../server/controller/PartyController.java | 30 ++++ .../controller/SysLogininforController.java | 4 + .../server/controller/SysUserController.java | 35 ++++ .../server/controller/WeatherController.java | 32 ++++ .../market/server/mapper/MyapiMapper.java | 9 + .../server/mapper/SysLogininforMapper.java | 9 + .../market/server/mapper/SysUserMapper.java | 9 + .../server/service/Impl/MyapiServiceImpl.java | 47 ++++++ .../Impl/SysLogininforServiceImpl.java | 20 +++ .../service/Impl/SysUserServiceImpl.java | 50 ++++++ .../market/server/service/MyapiService.java | 21 +++ .../server/service/SysLogininforService.java | 13 ++ .../market/server/service/SysUserService.java | 23 +++ .../market/server/util/SelectPhoneUtil.java | 154 ++++++++++++++++++ .../market/server/util/SelectWeatherUtil.java | 148 +++++++++++++++++ ...ot.autoconfigure.AutoConfiguration.imports | 2 + .../src/main/resources/banner.txt | 2 + .../src/main/resources/bootstrap.yml | 56 +++++++ .../src/main/resources/logback/dev.xml | 74 +++++++++ .../src/main/resources/logback/prod.xml | 81 +++++++++ .../src/main/resources/logback/test.xml | 81 +++++++++ pom.xml | 32 ++++ 46 files changed, 2435 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 cloud-market2-client/pom.xml create mode 100644 cloud-market2-client/src/main/java/com/muyu/Main.java create mode 100644 cloud-market2-common/pom.xml create mode 100644 cloud-market2-common/src/main/java/com/muyu/Main.java create mode 100644 cloud-market2-common/src/main/java/com/muyu/market/admain/Myapi.java create mode 100644 cloud-market2-common/src/main/java/com/muyu/market/admain/SelectByPhone.java create mode 100644 cloud-market2-common/src/main/java/com/muyu/market/admain/SelectWeather.java create mode 100644 cloud-market2-common/src/main/java/com/muyu/market/admain/SysLogininfor.java create mode 100644 cloud-market2-common/src/main/java/com/muyu/market/admain/SysUser.java create mode 100644 cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiListReq.java create mode 100644 cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiSaveReq.java create mode 100644 cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiUpdReq.java create mode 100644 cloud-market2-common/src/main/java/com/muyu/market/admain/request/updUserMoneyReq.java create mode 100644 cloud-market2-common/src/main/java/com/muyu/market/admain/response/MyapiListResp.java create mode 100644 cloud-market2-common/src/main/java/com/muyu/market/admain/response/MyapiSaveResp.java create mode 100644 cloud-market2-common/src/main/java/com/muyu/market/admain/response/SysLogininforResp.java create mode 100644 cloud-market2-common/src/main/java/com/muyu/market/admain/response/updSysUserMoneyResp.java create mode 100644 cloud-market2-remote/pom.xml create mode 100644 cloud-market2-remote/src/main/java/com/muyu/Main.java create mode 100644 cloud-market2-server/pom.xml create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/MarketApplication.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/controller/MyapiController.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/controller/PartyController.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/controller/SysLogininforController.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/controller/SysUserController.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/controller/WeatherController.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/mapper/MyapiMapper.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/mapper/SysLogininforMapper.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/mapper/SysUserMapper.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/MyapiServiceImpl.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/SysLogininforServiceImpl.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/SysUserServiceImpl.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/service/MyapiService.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/service/SysLogininforService.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/service/SysUserService.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/util/SelectPhoneUtil.java create mode 100644 cloud-market2-server/src/main/java/com/muyu/market/server/util/SelectWeatherUtil.java create mode 100644 cloud-market2-server/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports create mode 100644 cloud-market2-server/src/main/resources/banner.txt create mode 100644 cloud-market2-server/src/main/resources/bootstrap.yml create mode 100644 cloud-market2-server/src/main/resources/logback/dev.xml create mode 100644 cloud-market2-server/src/main/resources/logback/prod.xml create mode 100644 cloud-market2-server/src/main/resources/logback/test.xml create mode 100644 pom.xml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..afb9337 --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/ +logs +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..eb4da3e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +#指定构建镜像的起始镜像 +FROM anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/dragonwell:17.0.4.0.4.8-standard-ga-8.6 +#定义时区参数 +ENV TZ=Asia/Shanghai +#设置时区 +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone + +#挂载目录 +VOLUME ["/home/logs/cloud-market2"] + +#拷贝执行jar报 +COPY ./cloud-market2-server/target/cloud-market2.jar /home/app.jar + +ENTRYPOINT ["java","-Dfile.encoding=utf-8","-jar"] + +CMD ["/home/app.jar"] diff --git a/cloud-market2-client/pom.xml b/cloud-market2-client/pom.xml new file mode 100644 index 0000000..40c7328 --- /dev/null +++ b/cloud-market2-client/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + com.muyu + cloud-market2 + 1.0.0 + + + cloud-market2-client + 1.0.0 + + 17 + 17 + UTF-8 + + + + + com.muyu + cloud-market2-common + 1.0.0 + + + + diff --git a/cloud-market2-client/src/main/java/com/muyu/Main.java b/cloud-market2-client/src/main/java/com/muyu/Main.java new file mode 100644 index 0000000..bb76c9e --- /dev/null +++ b/cloud-market2-client/src/main/java/com/muyu/Main.java @@ -0,0 +1,8 @@ +package com.muyu; + + +public class Main { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} diff --git a/cloud-market2-common/pom.xml b/cloud-market2-common/pom.xml new file mode 100644 index 0000000..e471363 --- /dev/null +++ b/cloud-market2-common/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + com.muyu + cloud-market2 + 1.0.0 + + + cloud-market2-common + 1.0.0 + + + 17 + 17 + UTF-8 + + + + com.muyu + cloud-common-core + + + diff --git a/cloud-market2-common/src/main/java/com/muyu/Main.java b/cloud-market2-common/src/main/java/com/muyu/Main.java new file mode 100644 index 0000000..bb76c9e --- /dev/null +++ b/cloud-market2-common/src/main/java/com/muyu/Main.java @@ -0,0 +1,8 @@ +package com.muyu; + + +public class Main { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/Myapi.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/Myapi.java new file mode 100644 index 0000000..43036df --- /dev/null +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/Myapi.java @@ -0,0 +1,119 @@ +package com.muyu.market.admain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.common.core.web.domain.BaseEntity; +import com.muyu.market.admain.request.MyapiSaveReq; +import com.muyu.market.admain.request.MyapiUpdReq; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.function.Supplier; + +@Data +@SuperBuilder +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "market_myapi",autoResultMap = true) +@EqualsAndHashCode(callSuper = true) +public class Myapi extends BaseEntity{ + /** + * 商品ID + */ + @TableId(value = "api_id",type = IdType.AUTO) + private Long apiId; + /** + * 接口名称 + */ + @Schema(type = "String",description = "接口名称") + private String name; + /** + * 价钱 + */ + @Schema(description = "价钱/次",type = "BigDecimal") + private BigDecimal price; + /** + * 介绍 + */ + @Schema(type = "String",description = "介绍") + private String test; + /** + * 商品描述 + */ + @Schema(description = "商品描述",type = "String") + private String data; + /** + * 接口名称 + */ + @Schema(description = "接口名称",type = "String") + private String apiName; + /** + * 接口地址 + */ + @Schema(description = "接口地址",type = "String") + private String ip; + /** + * 请求方式 + */ + @Schema(description = "请求方式",type = "String") + private String mode; + /** + * 购买字段 + */ + @Schema(description = "购买字段(当修改成功触发)",type = "Integer") + private int auth; + /* + API类型 + */ + @Schema(description = "API类型",type = "String") + private String type; + + private String createBy; + private Date createTime; + private String updateBy; + private Date updateTime; + private String remark; + public static Myapi SaveMyapiList(MyapiSaveReq myapiSaveReq){ + + return Myapi + .builder() + .name( myapiSaveReq.getName()) + .price( myapiSaveReq.getPrice()) + .test( myapiSaveReq.getTest()) + .data( myapiSaveReq.getData()) + .apiName( myapiSaveReq.getApiName()) + .ip( myapiSaveReq.getIp()) + .mode( myapiSaveReq.getMode()) + .auth( myapiSaveReq.getAuth() ) + .type( myapiSaveReq.getType()) + .build(); + } + + + public static Myapi UpdMyapiList(MyapiUpdReq myapiUpdReq, Supplier apiId){ + + return Myapi + .builder() + .apiId(apiId.get()) + .name( myapiUpdReq.getName()) + .price( myapiUpdReq.getPrice()) + .test( myapiUpdReq.getTest()) + .data( myapiUpdReq.getData()) + .apiName( myapiUpdReq.getApiName()) + .ip( myapiUpdReq.getIp()) + .mode( myapiUpdReq.getMode()) + .auth( myapiUpdReq.getAuth() ) + .type( myapiUpdReq.getType()) + .build(); + } + + + +} diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/SelectByPhone.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/SelectByPhone.java new file mode 100644 index 0000000..bc774c0 --- /dev/null +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/SelectByPhone.java @@ -0,0 +1,18 @@ +package com.muyu.market.admain; + +import lombok.Data; + +@Data +public class SelectByPhone { + // 省份 + private String province; + // 城市 + private String city; + // 区号 + private String areacode; + // 邮编 + private String zip; + // 运营商 + private String company; + +} diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/SelectWeather.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/SelectWeather.java new file mode 100644 index 0000000..a7feed1 --- /dev/null +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/SelectWeather.java @@ -0,0 +1,37 @@ +package com.muyu.market.admain; + +import lombok.Data; + +@Data +public class SelectWeather { + + /** + * 城市 + */ + private String city; + /** + * 天气 + */ + private String info; + /** + * 温度 + */ + private String temperature; + /** + * 湿度 + */ + private String humidity; + /** + * 风向 + */ + private String direct; + /** + * 风力 + */ + private String power; + /** + * 空气质量 + */ + private String aqi; + +} diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/SysLogininfor.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/SysLogininfor.java new file mode 100644 index 0000000..580eb72 --- /dev/null +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/SysLogininfor.java @@ -0,0 +1,56 @@ +package com.muyu.market.admain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.muyu.common.core.web.domain.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@SuperBuilder +@EqualsAndHashCode(callSuper = true) +@TableName(value = "sys_logininfor",autoResultMap = true) +@Tag( name="登录日志",description = "记录登录操作") +public class SysLogininfor extends BaseEntity { + /* + 访问ID + */ + @TableId(value = "info_id",type = IdType.AUTO) + private Long infoId; + /* + 用户账号 + */ + @Schema(description = "用户名",type = "String") + private String userName; + /* + 登录IP地址 + */ + @Schema(description = "用户账号",type = "String") + private String ipaddr; + /* + 登录状态(0成功 1失败) + */ + @Schema(description = "登录IP地址",type = "char") + private Character status; + /* + 提示信息 + */ + @Schema(description = "登录状态(0成功 1失败)",type = "String") + private String msg; + /* + 访问时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "提示信息",type = "Date") + private Data accessTime; + +} diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/SysUser.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/SysUser.java new file mode 100644 index 0000000..b0ac466 --- /dev/null +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/SysUser.java @@ -0,0 +1,130 @@ +package com.muyu.market.admain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@SuperBuilder +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "sys_user",autoResultMap = true) +@EqualsAndHashCode(callSuper = true) +public class SysUser extends BaseEntity { + /** + * 用户ID + */ + @TableId(value = "user_id",type = IdType.AUTO) + private Long userId; + /** + * 部门ID + */ + @Schema(description = "部门ID",type = "Long") + private Long deptId; + /** + * 用户账号 + */ + @Schema(description = "用户账号",type = "String") + private String userName; + /** + * 用户昵称 + */ + @Schema(description = "用户昵称",type = "String") + private String nickName; + /** + * 用户类型 + */ + @Schema(description = "用户类型(00系统用户)",type = "String") + private String userType; + /** + * 余额 + */ + @Schema(description = "余额",type = "BigDecimal") + private BigDecimal money; + /** + * 用户邮箱 + */ + @Schema(description = "用户邮箱",type = "String") + private String email; + /** + * 手机号码 + */ + @Schema(description = "手机号码",type = "String") + private String phonenumber; + /** + * 用户性别(0男 1女 2未知) + */ + @Schema(description = "用户性别(0男 1女 2未知)",type = "String") + private String sex; + + /** + * 头像地址 + */ + @Schema(description = "头像地址",type = "String") + private String avatar; + /** + * 密码 + */ + @Schema(description = "密码",type = "String") + private String password; + /** + * 帐号状态(0正常 1停用) + */ + @Schema(description = "帐号状态(0正常 1停用)",type = "Character") + private Character status; + /** + * 删除标志(0代表存在 2代表删除) + */ + @Schema(description = "删除标志(0代表存在 2代表删除)",type = "Character") + private Character delFlag; + /** + * 最后登录IP + */ + @Schema(description = "最后登录IP",type = "String") + private String loginIp; + /** + * 最后登录时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "最后登录时间",type = "Date") + private Date loginDate; + /** + * 创建者 + */ + @Schema(description = "创建者",type = "String") + private String createBy; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "创建时间",type = "Date") + private Date createTime; + + /* + 更新者 + */ + @Schema(description = "更新者",type = "String") + private String updateBy; + /* + 更新时间 + */ + @Schema(description = "更新时间",type = "Date") + private Date updateTime; + /* + 备注 + */ + @Schema(description = "备注",type = "String") + private String remark; +} diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiListReq.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiListReq.java new file mode 100644 index 0000000..3bb0cef --- /dev/null +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiListReq.java @@ -0,0 +1,75 @@ +package com.muyu.market.admain.request; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@SuperBuilder +@Tag(name = "商品展示请求", description = "商品展示请求") +public class MyapiListReq { + /** + * 商品ID + */ + @TableId(value = "api_id",type = IdType.AUTO) + private Long apiId; + /** + * 接口名称 + */ + @Schema(type = "String",description = "接口名称") + private String name; + /** + * 价钱 + */ + @Schema(description = "价钱/次",type = "BigDecimal") + private BigDecimal price; + /** + * 介绍 + */ + @Schema(type = "String",description = "介绍") + private String test; + /** + * 商品描述 + */ + @Schema(description = "商品描述",type = "String") + private String data; + /** + * 接口名称 + */ + @Schema(description = "接口名称",type = "String") + private String apiName; + /** + * 接口地址 + */ + @Schema(description = "接口地址",type = "String") + private String ip; + /** + * 请求方式 + */ + @Schema(description = "请求方式",type = "String") + private String mode; + /** + * 购买字段 + */ + @Schema(description = "购买字段(当修改成功触发)",type = "Integer") + private int auth; + /* + API类型 + */ + @Schema(description = "API类型",type = "String") + private String type; + + + +} diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiSaveReq.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiSaveReq.java new file mode 100644 index 0000000..b301e78 --- /dev/null +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiSaveReq.java @@ -0,0 +1,78 @@ +package com.muyu.market.admain.request; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@SuperBuilder +@Tag(name = "商品添加", description = "商品添加") +public class MyapiSaveReq { + /** + * 商品ID + */ + @TableId(value = "api_id",type = IdType.AUTO) + private Long apiId; + /** + * 接口名称 + */ + @Schema(type = "String",description = "接口名称") + private String name; + /** + * 价钱 + */ + @Schema(description = "价钱/次",type = "BigDecimal") + private BigDecimal price; + /** + * 介绍 + */ + @Schema(type = "String",description = "介绍") + private String test; + /** + * 商品描述 + */ + @Schema(description = "商品描述",type = "String") + private String data; + /** + * 接口名称 + */ + @Schema(description = "接口名称",type = "String") + private String apiName; + /** + * 接口地址 + */ + @Schema(description = "接口地址",type = "String") + private String ip; + /** + * 请求方式 + */ + @Schema(description = "请求方式",type = "String") + private String mode; + /** + * 购买字段 + */ + @Schema(description = "购买字段(当修改成功触发)",type = "Integer") + private int auth; + /* + API类型 + */ + @Schema(description = "API类型",type = "String") + private String type; + + + + + + +} diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiUpdReq.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiUpdReq.java new file mode 100644 index 0000000..31b6a71 --- /dev/null +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiUpdReq.java @@ -0,0 +1,76 @@ +package com.muyu.market.admain.request; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@SuperBuilder +@Tag(name = "商品修改", description = "商品修改") +public class MyapiUpdReq { + /** + * 商品ID + */ + @TableId(value = "api_id",type = IdType.AUTO) + private Long apiId; + /** + * 接口名称 + */ + @Schema(type = "String",description = "接口名称") + private String name; + /** + * 价钱 + */ + @Schema(description = "价钱/次",type = "BigDecimal") + private BigDecimal price; + /** + * 介绍 + */ + @Schema(type = "String",description = "介绍") + private String test; + /** + * 商品描述 + */ + @Schema(description = "商品描述",type = "String") + private String data; + /** + * 接口名称 + */ + @Schema(description = "接口名称",type = "String") + private String apiName; + /** + * 接口地址 + */ + @Schema(description = "接口地址",type = "String") + private String ip; + /** + * 请求方式 + */ + @Schema(description = "请求方式",type = "String") + private String mode; + /** + * 购买字段 + */ + @Schema(description = "购买字段(当修改成功触发)",type = "Integer") + private int auth; + /* + API类型 + */ + @Schema(description = "API类型",type = "String") + private String type; + + + + +} diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/request/updUserMoneyReq.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/request/updUserMoneyReq.java new file mode 100644 index 0000000..856fde7 --- /dev/null +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/request/updUserMoneyReq.java @@ -0,0 +1,127 @@ +package com.muyu.market.admain.request; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@SuperBuilder +@Tag(name = "充值余额", description = "用于发送充值请求参数") +public class updUserMoneyReq { + /** + * 用户ID + */ + @TableId(value = "user_id",type = IdType.AUTO) + private Long userId; + /** + * 部门ID + */ + @Schema(description = "部门ID",type = "Long") + private Long deptId; + /** + * 用户账号 + */ + @Schema(description = "用户账号",type = "String") + private String userName; + /** + * 用户昵称 + */ + @Schema(description = "用户昵称",type = "String") + private String nickName; + /** + * 用户类型 + */ + @Schema(description = "用户类型(00系统用户)",type = "String") + private String userType; + /** + * 余额 + */ + @Schema(description = "余额",type = "BigDecimal") + private BigDecimal money; + /** + * 用户邮箱 + */ + @Schema(description = "用户邮箱",type = "String") + private String email; + /** + * 手机号码 + */ + @Schema(description = "手机号码",type = "String") + private String phonenumber; + /** + * 用户性别(0男 1女 2未知) + */ + @Schema(description = "用户性别(0男 1女 2未知)",type = "String") + private String sex; + + /** + * 头像地址 + */ + @Schema(description = "头像地址",type = "String") + private String avatar; + /** + * 密码 + */ + @Schema(description = "密码",type = "String") + private String password; + /** + * 帐号状态(0正常 1停用) + */ + @Schema(description = "帐号状态(0正常 1停用)",type = "Character") + private Character status; + /** + * 删除标志(0代表存在 2代表删除) + */ + @Schema(description = "删除标志(0代表存在 2代表删除)",type = "Character") + private Character delFlag; + /** + * 最后登录IP + */ + @Schema(description = "最后登录IP",type = "String") + private String loginIp; + /** + * 最后登录时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "最后登录时间",type = "Date") + private Date loginDate; + /** + * 创建者 + */ + @Schema(description = "创建者",type = "String") + private String createBy; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "创建时间",type = "Date") + private Date createTime; + + /* + 更新者 + */ + @Schema(description = "更新者",type = "String") + private String updateBy; + /* + 更新时间 + */ + @Schema(description = "更新时间",type = "Date") + private Date updateTime; + /* + 备注 + */ + @Schema(description = "备注",type = "String") + private String remark; + +} diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/response/MyapiListResp.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/response/MyapiListResp.java new file mode 100644 index 0000000..ae9275a --- /dev/null +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/response/MyapiListResp.java @@ -0,0 +1,97 @@ +package com.muyu.market.admain.response; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.muyu.market.admain.Myapi; + +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@SuperBuilder +@Tag(name = "商品展示", description = "商品展示") +public class MyapiListResp { + /** + * 商品ID + */ + @TableId(value = "api_id",type = IdType.AUTO) + private Long apiId; + /** + * 接口名称 + */ + @Schema(type = "String",description = "接口名称") + private String name; + /** + * 价钱 + */ + @Schema(description = "价钱/次",type = "BigDecimal") + private BigDecimal price; + /** + * 介绍 + */ + @Schema(type = "String",description = "介绍") + private String test; + /** + * 商品描述 + */ + @Schema(description = "商品描述",type = "String") + private String data; + /** + * 接口名称 + */ + @Schema(description = "接口名称",type = "String") + private String apiName; + /** + * 接口地址 + */ + @Schema(description = "接口地址",type = "String") + private String ip; + /** + * 请求方式 + */ + @Schema(description = "请求方式",type = "String") + private String mode; + /** + * 购买字段 + */ + @Schema(description = "购买字段(当修改成功触发)",type = "Integer") + private int auth; + /* + API类型 + */ + @Schema(description = "API类型",type = "String") + private String type; + + + + public static MyapiListResp selProductList(Myapi myapi){ + + return MyapiListResp + .builder() + .apiId( myapi.getApiId()) + .name( myapi.getName()) + .price( myapi.getPrice()) + .test( myapi.getTest()) + .data( myapi.getData()) + .apiName( myapi.getApiName()) + .ip( myapi.getIp()) + .mode( myapi.getMode()) + .auth( myapi.getAuth()) + .type( myapi.getType()) + .build(); + } + private String createBy; + private Date createTime; + private String updateBy; + private Date updateTime; + private String remark; +} diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/response/MyapiSaveResp.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/response/MyapiSaveResp.java new file mode 100644 index 0000000..60f6fe6 --- /dev/null +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/response/MyapiSaveResp.java @@ -0,0 +1,84 @@ +package com.muyu.market.admain.response; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; + +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@SuperBuilder +@Tag(name = "商品添加", description = "商品添加") +public class MyapiSaveResp { + /** + * 商品ID + */ + @TableId(value = "api_id",type = IdType.AUTO) + private Long apiId; + /** + * 接口名称 + */ + @Schema(type = "String",description = "接口名称") + private String name; + /** + * 价钱 + */ + @Schema(description = "价钱/次",type = "BigDecimal") + private BigDecimal price; + /** + * 介绍 + */ + @Schema(type = "String",description = "介绍") + private String test; + /** + * 商品描述 + */ + @Schema(description = "商品描述",type = "String") + private String data; + /** + * 接口名称 + */ + @Schema(description = "接口名称",type = "String") + private String apiName; + /** + * 接口地址 + */ + @Schema(description = "接口地址",type = "String") + private String ip; + /** + * 请求方式 + */ + @Schema(description = "请求方式",type = "String") + private String mode; + /** + * 购买字段 + */ + @Schema(description = "购买字段(当修改成功触发)",type = "Integer") + private int auth; + /* + API类型 + */ + @Schema(description = "API类型",type = "String") + private String type; + + + private String createBy; + private Date createTime; + private String updateBy; + private Date updateTime; + private String remark; + + + + +} diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/response/SysLogininforResp.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/response/SysLogininforResp.java new file mode 100644 index 0000000..ec6fcc3 --- /dev/null +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/response/SysLogininforResp.java @@ -0,0 +1,56 @@ +package com.muyu.market.admain.response; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.muyu.common.core.web.domain.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@SuperBuilder +@EqualsAndHashCode(callSuper = true) +@TableName(value = "sys_logininfor",autoResultMap = true) +@Tag( name="登录日志",description = "记录登录操作") +public class SysLogininforResp extends BaseEntity { + /* + 访问ID + */ + @TableId(value = "info_id",type = IdType.AUTO) + private Long infoId; + /* + 用户账号 + */ + @Schema(description = "用户名",type = "String") + private String userName; + /* + 登录IP地址 + */ + @Schema(description = "用户账号",type = "String") + private String ipaddr; + /* + 登录状态(0成功 1失败) + */ + @Schema(description = "登录IP地址",type = "char") + private Character status; + /* + 提示信息 + */ + @Schema(description = "登录状态(0成功 1失败)",type = "String") + private String msg; + /* + 访问时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "提示信息",type = "Date") + private Data accessTime; + +} diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/response/updSysUserMoneyResp.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/response/updSysUserMoneyResp.java new file mode 100644 index 0000000..1a7ab6e --- /dev/null +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/response/updSysUserMoneyResp.java @@ -0,0 +1,126 @@ +package com.muyu.market.admain.response; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@SuperBuilder +@Tag(name = "充值余额返回", description = "用于响应充值请求参数") +public class updSysUserMoneyResp { + /** + * 用户ID + */ + @TableId(value = "user_id",type = IdType.AUTO) + private Long userId; + /** + * 部门ID + */ + @Schema(description = "部门ID",type = "Long") + private Long deptId; + /** + * 用户账号 + */ + @Schema(description = "用户账号",type = "String") + private String userName; + /** + * 用户昵称 + */ + @Schema(description = "用户昵称",type = "String") + private String nickName; + /** + * 用户类型 + */ + @Schema(description = "用户类型",type = "String") + private String userType; + /** + * 余额 + */ + @Schema(description = "余额",type = "BigDecimal") + private BigDecimal money; + /** + * 用户邮箱 + */ + @Schema(description = "用户邮箱",type = "String") + private String email; + /** + * 手机号码 + */ + @Schema(description = "用户邮箱",type = "String") + private String phonenumber; + /** + * 用户性别(0男 1女 2未知) + */ + @Schema(description = "用户性别",type = "String") + private String sex; + + /** + * 头像地址 + */ + @Schema(description = "头像地址",type = "String") + private String avatar; + /** + * 密码 + */ + @Schema(description = "密码",type = "String") + private String password; + /** + * 帐号状态(0正常 1停用) + */ + @Schema(description = "帐号状态",type = "String") + private String status; + /** + * 删除标志(0代表存在 2代表删除) + */ + @Schema(description = "删除标志",type = "String") + private String delFlag; + /** + * 最后登录IP + */ + @Schema(description = "最后登录IP",type = "String") + private String loginIp; + /** + * 最后登录时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "最后登录时间",defaultValue = "2024-5-15 10:00:52",type = "Date") + private Date loginDate; + /** + * 创建者 + */ + @Schema(description = "创建者",type = "String") + private String createBy; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "创建时间",defaultValue = "2024-5-15 10:00:52",type = "Date") + private Date createTime; + /** + * 更新者 + */ + @Schema(description = "更新者",type = "String") + private String updateBy; + /** + * 更新时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "更新时间",defaultValue = "2024-5-15 10:00:52",type = "Date") + private Date updateTime; + /** + * 备注 + */ + @Schema(description = "备注",type = "String") + private String remark; +} diff --git a/cloud-market2-remote/pom.xml b/cloud-market2-remote/pom.xml new file mode 100644 index 0000000..54d193b --- /dev/null +++ b/cloud-market2-remote/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + com.muyu + cloud-market2 + 1.0.0 + + + cloud-market2-remote + 1.0.0 + + 17 + 17 + UTF-8 + + + + + com.muyu + cloud-market2-common + 1.0.0 + + + diff --git a/cloud-market2-remote/src/main/java/com/muyu/Main.java b/cloud-market2-remote/src/main/java/com/muyu/Main.java new file mode 100644 index 0000000..bb76c9e --- /dev/null +++ b/cloud-market2-remote/src/main/java/com/muyu/Main.java @@ -0,0 +1,8 @@ +package com.muyu; + + +public class Main { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} diff --git a/cloud-market2-server/pom.xml b/cloud-market2-server/pom.xml new file mode 100644 index 0000000..8f0d667 --- /dev/null +++ b/cloud-market2-server/pom.xml @@ -0,0 +1,151 @@ + + + 4.0.0 + + com.muyu + cloud-market2 + 1.0.0 + + + cloud-market2-server + 1.0.0 + + 17 + 17 + UTF-8 + + + + + + + commons-beanutils + commons-beanutils + 1.9.3 + + + commons-lang + commons-lang + 2.6 + + + commons-logging + commons-logging + 1.2 + + + + net.sf.json-lib + json-lib + 2.4 + jdk13 + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + com.mysql + mysql-connector-j + + + + + com.muyu + cloud-common-datasource + + + + + com.muyu + cloud-common-datascope + + + + + com.muyu + cloud-common-log + + + + + com.muyu + cloud-common-api-doc + + + + + com.muyu + cloud-common-xxl + + + + com.muyu + cloud-common-rabbit + 1.0.0 + + + + com.muyu + cloud-market2-common + 1.0.0 + + + + + com.muyu + cloud-common-nacos-api + + + + + + cloud-market2 + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + + diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/MarketApplication.java b/cloud-market2-server/src/main/java/com/muyu/market/server/MarketApplication.java new file mode 100644 index 0000000..8c6a5b2 --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/MarketApplication.java @@ -0,0 +1,17 @@ +package com.muyu.market.server; + +import com.muyu.common.security.annotation.EnableCustomConfig; +import com.muyu.common.security.annotation.EnableMyFeignClients; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +@SpringBootApplication +@EnableCustomConfig +@EnableMyFeignClients +public class MarketApplication { + public static void main(String[] args) { + SpringApplication.run(MarketApplication.class); + } + +} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/controller/MyapiController.java b/cloud-market2-server/src/main/java/com/muyu/market/server/controller/MyapiController.java new file mode 100644 index 0000000..aa94b07 --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/controller/MyapiController.java @@ -0,0 +1,103 @@ +package com.muyu.market.server.controller; + + +import com.muyu.common.core.domain.Result; +import com.muyu.market.admain.Myapi; +import com.muyu.market.admain.request.MyapiListReq; +import com.muyu.market.admain.request.MyapiSaveReq; +import com.muyu.market.admain.request.MyapiUpdReq; +import com.muyu.market.admain.response.MyapiListResp; +import com.muyu.market.server.service.MyapiService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +@Slf4j +@RestController +@RequestMapping("/myapi") +@Tag(name = "产品展示控制层",description = "产品展示控制层") +@RequiredArgsConstructor +public class MyapiController { + + + @Autowired + private MyapiService myapiService; + + + /** + * 展示商品 + * @param myapiListReq + * @return + */ + @RequestMapping(path = "/myapiList",method = RequestMethod.POST) + @Operation(summary = "查询产品接口",description = "根据接口数据可以查看产品信息") + public Result> findByMyapiList(@Validated @RequestBody MyapiListReq myapiListReq){ + return Result.success( myapiService.findByMyapiList( myapiListReq )); + } + + + + /** + * 添加接口 + * @param myapiSaveReq + * @return + */ + @PostMapping + @Operation(summary = "接口信息添加",description = "添加接口信息,添加成功才可以使用") + public Result save(@Validated @RequestBody MyapiSaveReq myapiSaveReq){ + myapiService.save( Myapi.SaveMyapiList( myapiSaveReq )); + return Result.success(null,"操作成功"); + } + + + /** + * 修改接口 + * @param myapiId + * @param myapiUpdReq + * @return + */ + @PutMapping("/{myapiId}") + @Operation(summary = "接口信息的修改",description = "通过Id修改接口信息") + public Result update( + @Schema(title = "商品ID",type = "Long",description = "修改商品信息",defaultValue = "1") + @PathVariable("myapiId") Long myapiId, + @RequestBody @Validated MyapiUpdReq myapiUpdReq){ + + myapiService.updateById( Myapi.UpdMyapiList( myapiUpdReq,()->myapiId)); + return Result.success(null,"操作成功"); + } + + /** + * 删除 + * @param myapiId + * @return + */ + @DeleteMapping + @Operation(summary = "产品删除",description = "根据ID删除") + public Result removeById(@Validated @RequestParam(value = "myapiId") Long myapiId){ + myapiService.removeById(myapiId); + return Result.success(null,"操作成功"); + } + /** + * 回显接口 + * @param myapiId + * @return + */ + @PostMapping("/selectById") + @Operation(summary = "产品详细信息",description = "根据ID查询产品") + public Result selectById(@Validated @RequestParam(value = "myapiId") Long myapiId){ + Myapi byId = myapiService.getById( myapiId ); + return Result.success(byId,"操作成功"); + } + + + +} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/controller/PartyController.java b/cloud-market2-server/src/main/java/com/muyu/market/server/controller/PartyController.java new file mode 100644 index 0000000..ce9580e --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/controller/PartyController.java @@ -0,0 +1,30 @@ +package com.muyu.market.server.controller; + +import com.muyu.market.admain.SelectByPhone; +import com.muyu.market.server.util.SelectPhoneUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +@Slf4j +@RestController +@RequestMapping("/party") +@Tag(name = "查询手机号",description = "订单查询") +public class PartyController { + + + @PostMapping("/selparty") + @Operation(summary = "查询手机号",description = "查询手机号") + public SelectByPhone selparty(@RequestParam("phoneNumber") String phoneNumber){ + + return SelectPhoneUtil.queryMobileLocation(phoneNumber); + } + + + + //测试 + public static void main(String[] args) { + SelectPhoneUtil.queryMobileLocation("18790307917"); + } +} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/controller/SysLogininforController.java b/cloud-market2-server/src/main/java/com/muyu/market/server/controller/SysLogininforController.java new file mode 100644 index 0000000..a81f76d --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/controller/SysLogininforController.java @@ -0,0 +1,4 @@ +//package com.muyu.market.server.controller; +// +//public class SysLogininforController { +//} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/controller/SysUserController.java b/cloud-market2-server/src/main/java/com/muyu/market/server/controller/SysUserController.java new file mode 100644 index 0000000..7ab6747 --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/controller/SysUserController.java @@ -0,0 +1,35 @@ +package com.muyu.market.server.controller; + +import com.muyu.common.core.domain.Result; +import com.muyu.market.admain.SysUser; +import com.muyu.market.server.service.SysUserService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/sysUser") +@Tag( name = "个人信息控制层",description = "用于操作用户个人信息") +public class SysUserController { + + + @Autowired + private SysUserService sysUserService; + + + @PostMapping("/findById") + @Operation(summary = "显示用户信息",description = "显示用户基本信息") + public Result findById(@RequestParam(value = "userId") Integer userId){ + SysUser byId = sysUserService.getById( userId ); + return Result.success(byId); + } + + @PostMapping("/updSysUserMoney") + @Operation(summary = "充值",description = "通过修改余额达到充值效果") + public Result updSysUserMoney(@Validated @RequestBody SysUser sysUser){ + Integer i = sysUserService.updSysUserMoney( sysUser ); + return i>0?Result.success():Result.error(500,"充值失败 请联系管理员"); + } +} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/controller/WeatherController.java b/cloud-market2-server/src/main/java/com/muyu/market/server/controller/WeatherController.java new file mode 100644 index 0000000..c53302f --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/controller/WeatherController.java @@ -0,0 +1,32 @@ +package com.muyu.market.server.controller; + +import com.muyu.market.admain.SelectWeather; +import com.muyu.market.server.util.SelectWeatherUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@Slf4j +@RestController +@RequestMapping("/weather") +@Tag(name = "查询天气",description = "查询天气") +public class WeatherController { + + + + @PostMapping("/selweather") + @Operation(summary = "查询天气",description = "查询天气") + public SelectWeather selweather(@RequestParam("cityName") String cityName){ + + return SelectWeatherUtil.queryWeather(cityName); + } + + + public static void main(String[] args) { + SelectWeatherUtil.queryWeather("南京"); + } +} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/mapper/MyapiMapper.java b/cloud-market2-server/src/main/java/com/muyu/market/server/mapper/MyapiMapper.java new file mode 100644 index 0000000..80998e5 --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/mapper/MyapiMapper.java @@ -0,0 +1,9 @@ +package com.muyu.market.server.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.market.admain.Myapi; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface MyapiMapper extends BaseMapper { +} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/mapper/SysLogininforMapper.java b/cloud-market2-server/src/main/java/com/muyu/market/server/mapper/SysLogininforMapper.java new file mode 100644 index 0000000..4ab7f45 --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/mapper/SysLogininforMapper.java @@ -0,0 +1,9 @@ +//package com.muyu.market.server.mapper; +// +//import com.baomidou.mybatisplus.core.mapper.BaseMapper; +//import com.muyu.market.admain.SysLogininfor; +//import org.apache.ibatis.annotations.Mapper; +// +//@Mapper +//public interface SysLogininforMapper extends BaseMapper { +//} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/mapper/SysUserMapper.java b/cloud-market2-server/src/main/java/com/muyu/market/server/mapper/SysUserMapper.java new file mode 100644 index 0000000..2c10a0d --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/mapper/SysUserMapper.java @@ -0,0 +1,9 @@ +package com.muyu.market.server.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.market.admain.SysUser; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface SysUserMapper extends BaseMapper { +} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/MyapiServiceImpl.java b/cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/MyapiServiceImpl.java new file mode 100644 index 0000000..7f47e76 --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/MyapiServiceImpl.java @@ -0,0 +1,47 @@ +package com.muyu.market.server.service.Impl; + +import com.alibaba.nacos.common.utils.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.market.admain.Myapi; +import com.muyu.market.admain.request.MyapiListReq; +import com.muyu.market.admain.response.MyapiListResp; +import com.muyu.market.server.mapper.MyapiMapper; +import com.muyu.market.server.service.MyapiService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.stream.Collectors; + + +@Service +public class MyapiServiceImpl extends ServiceImpl implements MyapiService { + + + @Autowired + private MyapiMapper myapiMapper; + @Override + public List findByMyapiList(MyapiListReq myapiListReq) { + + + LambdaQueryWrapper lambdaQueryWrapperlist = new LambdaQueryWrapper<>(); + /** + * 查询接口名称 + */ + + if (StringUtils.isNotBlank( myapiListReq.getName())) { + lambdaQueryWrapperlist.like( Myapi::getName, myapiListReq.getName()); + } + + List productlist = this.list(lambdaQueryWrapperlist); + + return productlist.stream() + .map( MyapiListResp::selProductList) + .collect(Collectors.toList()); + + + } + + +} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/SysLogininforServiceImpl.java b/cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/SysLogininforServiceImpl.java new file mode 100644 index 0000000..34ab621 --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/SysLogininforServiceImpl.java @@ -0,0 +1,20 @@ +//package com.muyu.market.server.service.Impl; +// +//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +//import com.muyu.market.admain.SysLogininfor; +// +//import com.muyu.market.admain.response.SysLogininforResp; +//import com.muyu.market.server.mapper.SysLogininforMapper; +//import com.muyu.market.server.service.SysLogininforService; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Service; +// +//@Service +//public class SysLogininforServiceImpl extends ServiceImpl implements SysLogininforService { +// @Autowired +// private SysLogininforMapper sysLogininforMapper; +// @Override +// public SysLogininforResp selectLogininforByUserName(String userName) { +// return null; +// } +//} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/SysUserServiceImpl.java b/cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/SysUserServiceImpl.java new file mode 100644 index 0000000..acfb131 --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/SysUserServiceImpl.java @@ -0,0 +1,50 @@ +package com.muyu.market.server.service.Impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.utils.JwtUtils; +import com.muyu.market.admain.SysUser; +import com.muyu.market.server.mapper.SysUserMapper; +import com.muyu.market.server.service.SysUserService; +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.stereotype.Service; + +@Service +public class SysUserServiceImpl extends ServiceImpl implements SysUserService { + @Autowired + private HttpServletRequest request; + @Autowired + private StringRedisTemplate redisTemplate; + @Autowired + private SysUserMapper sysUserMapper; + + //充值余额 + @Override + public Integer updSysUserMoney(SysUser sysUser) { + //获取请求头Token + String token = request.getHeader( "token" ); + //转userkey + String userKey = JwtUtils.getUserKey( token ); + //通过key名字和Token取值 + String s = redisTemplate.opsForValue().get( "token:" + userKey ); + //转实体类类型 + SysUser user = JSONObject.parseObject( s, SysUser.class ); + UpdateWrapper sysUserUpdateWrapper = new UpdateWrapper<>(); + UpdateWrapper money = sysUserUpdateWrapper.setSql("money=money+"+sysUser.getMoney()). + eq( "user_id",user.getUserId() ); + return sysUserMapper.update( money ); + } + //回显用户信息 + @Override + public SysUser selectByUserId(Integer userId) { + return sysUserMapper.selectById( userId ); + } +} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/service/MyapiService.java b/cloud-market2-server/src/main/java/com/muyu/market/server/service/MyapiService.java new file mode 100644 index 0000000..0845251 --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/service/MyapiService.java @@ -0,0 +1,21 @@ +package com.muyu.market.server.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.market.admain.Myapi; +import com.muyu.market.admain.request.MyapiListReq; +import com.muyu.market.admain.response.MyapiListResp; + +import java.util.List; + +public interface MyapiService extends IService { + + /** + * 查询商品接口 + * + * @param myapiListReq + * @return + */ + List findByMyapiList(MyapiListReq myapiListReq); + + +} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/service/SysLogininforService.java b/cloud-market2-server/src/main/java/com/muyu/market/server/service/SysLogininforService.java new file mode 100644 index 0000000..e8294eb --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/service/SysLogininforService.java @@ -0,0 +1,13 @@ +//package com.muyu.market.server.service; +// +//import com.baomidou.mybatisplus.extension.service.IService; +//import com.muyu.market.admain.SysLogininfor; +//import com.muyu.market.admain.response.SysLogininforResp; +// +// +//public interface SysLogininforService extends IService { +// /* +// 根据名字查询登录日志表 +// */ +// SysLogininforResp selectLogininforByUserName(String userName); +//} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/service/SysUserService.java b/cloud-market2-server/src/main/java/com/muyu/market/server/service/SysUserService.java new file mode 100644 index 0000000..0a35485 --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/service/SysUserService.java @@ -0,0 +1,23 @@ +package com.muyu.market.server.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.market.admain.SysUser; + +public interface SysUserService extends IService { + + /** + * 充值用户余额 + * + * @param sysUser + * @return void + */ + Integer updSysUserMoney(SysUser sysUser); + + /** + * 回显用户余额 + * + * @param userId + * @return SysUser + */ + SysUser selectByUserId(Integer userId); +} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/util/SelectPhoneUtil.java b/cloud-market2-server/src/main/java/com/muyu/market/server/util/SelectPhoneUtil.java new file mode 100644 index 0000000..1fc300d --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/util/SelectPhoneUtil.java @@ -0,0 +1,154 @@ +package com.muyu.market.server.util; + +import com.muyu.market.admain.SelectByPhone; +import net.sf.json.JSONObject; +import org.springframework.web.bind.annotation.RestController; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; + +@RestController +public class SelectPhoneUtil { + // 手机归属地查询接口地址 + public static String API_URL = "http://apis.juhe.cn/mobile/get"; + // 接口请求Key + public static String API_KEY = "4cfc25ee624fc08ad83b61a3a0ab1bcb"; + + + /** + * 根据手机号码/手机号码前7位查询号码归属地 + * @param mobile + */ + public static SelectByPhone queryMobileLocation(String mobile) + { + Map params = new HashMap<>();//组合参数 + params.put("phone", mobile); + params.put("key", API_KEY); + String queryParams = urlencode(params); + + String response = doGet(API_URL, queryParams); + SelectByPhone selectByPhone = new SelectByPhone(); + try { + JSONObject jsonObject = JSONObject.fromObject(response); + int error_code = jsonObject.getInt("error_code"); + if (error_code == 0) { + System.out.println("调用接口成功"); + + JSONObject result = jsonObject.getJSONObject("result"); + + System.out.printf("省份:%s%n", result.getString("province")); + System.out.printf("城市:%s%n", result.getString("city")); + System.out.printf("区号:%s%n", result.getString("areacode")); + System.out.printf("邮编:%s%n", result.getString("zip")); + System.out.printf("运营商:%s%n", result.getString("company")); +// 设置编码(仅在需要时启用) + try { + System.setOut(new java.io.PrintStream(System.out,true,"UTF-8")); + } catch (java.io.UnsupportedEncodingException e) { + System.err.println("无法设置UTF-8编码:" + e.getMessage()); + } + selectByPhone.setCompany(result.getString("company")); + selectByPhone.setCity(result.getString("city")); + selectByPhone.setZip(result.getString("zip")); + selectByPhone.setAreacode(result.getString("areacode")); + selectByPhone.setProvince(result.getString("province")); + + + } else { + System.out.println("调用接口失败:" + jsonObject.getString("reason")); + } + } catch (Exception e) { + e.printStackTrace(); + } + return selectByPhone; + } + + /** + * get方式的http请求 + * + * @param httpUrl 请求地址 + * @return 返回结果 + */ + public static String doGet(String httpUrl, String queryParams) { + HttpURLConnection connection = null; + InputStream inputStream = null; + BufferedReader bufferedReader = null; + String result = null;// 返回结果字符串 + try { + // 创建远程url连接对象 + URL url = new URL(new StringBuffer(httpUrl).append("?").append(queryParams).toString()); + // 通过远程url连接对象打开一个连接,强转成httpURLConnection类 + connection = (HttpURLConnection) url.openConnection(); + // 设置连接方式:get + connection.setRequestMethod("GET"); + // 设置连接主机服务器的超时时间:15000毫秒 + connection.setConnectTimeout(5000); + // 设置读取远程返回的数据时间:60000毫秒 + connection.setReadTimeout(6000); + // 发送请求 + connection.connect(); + // 通过connection连接,获取输入流 + if (connection.getResponseCode() == 200) { + inputStream = connection.getInputStream(); + // 封装输入流,并指定字符集 + bufferedReader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); + // 存放数据 + StringBuilder sbf = new StringBuilder(); + String temp; + while ((temp = bufferedReader.readLine()) != null) { + sbf.append(temp); + sbf.append(System.getProperty("line.separator")); + } + result = sbf.toString(); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + // 关闭资源 + if (null != bufferedReader) { + try { + bufferedReader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (null != inputStream) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (connection != null) { + connection.disconnect();// 关闭远程连接 + } + } + return result; + } + + /** + * 将map型转为请求参数型 + * + * @param data + * @return + */ + public static String urlencode(Map data) { + StringBuilder sb = new StringBuilder(); + for (Map.Entry i : data.entrySet()) { + try { + sb.append(i.getKey()).append("=").append(URLEncoder.encode(i.getValue() + "", "UTF-8")).append("&"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + String result = sb.toString(); + result = result.substring(0, result.lastIndexOf("&")); + return result; + } + +} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/util/SelectWeatherUtil.java b/cloud-market2-server/src/main/java/com/muyu/market/server/util/SelectWeatherUtil.java new file mode 100644 index 0000000..710bc99 --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/util/SelectWeatherUtil.java @@ -0,0 +1,148 @@ +package com.muyu.market.server.util; +import com.muyu.market.admain.SelectWeather; +import net.sf.json.JSONObject; +import org.springframework.web.bind.annotation.RestController; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; +@RestController +public class SelectWeatherUtil { + + + // 天气情况查询接口地址 + public static String API_URL = "http://apis.juhe.cn/simpleWeather/query"; + // 接口请求Key + public static String API_KEY = "2e7b031d32a2eac211c099bf4918a4dd"; + + + /** + * 根据城市名查询天气情况 + * + * @param cityName + */ + public static SelectWeather queryWeather(String cityName) { + Map params = new HashMap<>();//组合参数 + params.put("city", cityName); + params.put("key", API_KEY); + String queryParams = urlencode(params); + + String response = doGet(API_URL, queryParams); + SelectWeather selectWeather = new SelectWeather(); + + try { + JSONObject jsonObject = JSONObject.fromObject(response); + int error_code = jsonObject.getInt("error_code"); + if (error_code == 0) { + System.out.println("调用接口成功"); + + JSONObject result = jsonObject.getJSONObject("result"); + JSONObject realtime = result.getJSONObject("realtime"); + + System.out.printf("城市:%s%n", result.getString("city")); + System.out.printf("天气:%s%n", realtime.getString("info")); + System.out.printf("温度:%s%n", realtime.getString("temperature")); + System.out.printf("湿度:%s%n", realtime.getString("humidity")); + System.out.printf("风向:%s%n", realtime.getString("direct")); + System.out.printf("风力:%s%n", realtime.getString("power")); + System.out.printf("空气质量:%s%n", realtime.getString("aqi")); + + + + } else { + System.out.println("调用接口失败:" + jsonObject.getString("reason")); + } + } catch (Exception e) { + e.printStackTrace(); + } + return selectWeather; + } + + /** + * get方式的http请求 + * + * @param httpUrl 请求地址 + * @return 返回结果 + */ + public static String doGet(String httpUrl, String queryParams) { + HttpURLConnection connection = null; + InputStream inputStream = null; + BufferedReader bufferedReader = null; + String result = null;// 返回结果字符串 + try { + // 创建远程url连接对象 + URL url = new URL(new StringBuffer(httpUrl).append("?").append(queryParams).toString()); + // 通过远程url连接对象打开一个连接,强转成httpURLConnection类 + connection = (HttpURLConnection) url.openConnection(); + // 设置连接方式:get + connection.setRequestMethod("GET"); + // 设置连接主机服务器的超时时间:15000毫秒 + connection.setConnectTimeout(5000); + // 设置读取远程返回的数据时间:60000毫秒 + connection.setReadTimeout(6000); + // 发送请求 + connection.connect(); + // 通过connection连接,获取输入流 + if (connection.getResponseCode() == 200) { + inputStream = connection.getInputStream(); + // 封装输入流,并指定字符集 + bufferedReader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); + // 存放数据 + StringBuilder sbf = new StringBuilder(); + String temp; + while ((temp = bufferedReader.readLine()) != null) { + sbf.append(temp); + sbf.append(System.getProperty("line.separator")); + } + result = sbf.toString(); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + // 关闭资源 + if (null != bufferedReader) { + try { + bufferedReader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (null != inputStream) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (connection != null) { + connection.disconnect();// 关闭远程连接 + } + } + return result; + } + + /** + * 将map型转为请求参数型 + * + * @param data + * @return + */ + public static String urlencode(Map data) { + StringBuilder sb = new StringBuilder(); + for (Map.Entry i : data.entrySet()) { + try { + sb.append(i.getKey()).append("=").append(URLEncoder.encode(i.getValue() + "", "UTF-8")).append("&"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + String result = sb.toString(); + result = result.substring(0, result.lastIndexOf("&")); + return result; + } + +} diff --git a/cloud-market2-server/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/cloud-market2-server/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..9be35bd --- /dev/null +++ b/cloud-market2-server/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1,2 @@ +com.muyu.market.server.MarketApplication +com.muyu.Main diff --git a/cloud-market2-server/src/main/resources/banner.txt b/cloud-market2-server/src/main/resources/banner.txt new file mode 100644 index 0000000..0dd5eee --- /dev/null +++ b/cloud-market2-server/src/main/resources/banner.txt @@ -0,0 +1,2 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} diff --git a/cloud-market2-server/src/main/resources/bootstrap.yml b/cloud-market2-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..cf87e4c --- /dev/null +++ b/cloud-market2-server/src/main/resources/bootstrap.yml @@ -0,0 +1,56 @@ +# Tomcat +server: + port: 6666 + +# nacos线上地址 +nacos: + addr: 12.2.0.252:8848 + user-name: nacos + password: nacos + namespace: muyu-cloud + +# Spring +spring: + main: + allow-bean-definition-overriding: true + application: + # 应用名称 + name: cloud-market2 + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: ${nacos.addr} + # nacos用户名 + username: ${nacos.user-name} + # nacos密码 + password: ${nacos.password} + # 命名空间 + namespace: ${nacos.namespace} + config: + # 服务注册地址 + server-addr: ${nacos.addr} + # nacos用户名 + username: ${nacos.user-name} + # nacos密码 + password: ${nacos.password} + # 命名空间 + namespace: ${nacos.namespace} + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + # 系统共享配置 + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + # 系统环境Config共享配置 + - application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + # xxl-job 配置文件 + - application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + # rabbit 配置文件 + - application-rabbit-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} +logging: + level: + com.muyu.system.mapper: DEBUG diff --git a/cloud-market2-server/src/main/resources/logback/dev.xml b/cloud-market2-server/src/main/resources/logback/dev.xml new file mode 100644 index 0000000..a0e16b0 --- /dev/null +++ b/cloud-market2-server/src/main/resources/logback/dev.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + diff --git a/cloud-market2-server/src/main/resources/logback/prod.xml b/cloud-market2-server/src/main/resources/logback/prod.xml new file mode 100644 index 0000000..afd0098 --- /dev/null +++ b/cloud-market2-server/src/main/resources/logback/prod.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + ${log.sky.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + + + ERROR + + ACCEPT + + DENY + + + + + + + + ${log.sky.pattern} + + + + + + + + + + + + + + + + + + + + diff --git a/cloud-market2-server/src/main/resources/logback/test.xml b/cloud-market2-server/src/main/resources/logback/test.xml new file mode 100644 index 0000000..afd0098 --- /dev/null +++ b/cloud-market2-server/src/main/resources/logback/test.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + ${log.sky.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + + + ERROR + + ACCEPT + + DENY + + + + + + + + ${log.sky.pattern} + + + + + + + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..a264c50 --- /dev/null +++ b/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + com.muyu + cloud-server-parent + 3.6.4 + + + cloud-market2 + 1.0.0 + pom + + cloud-market2-client + cloud-market2-common + cloud-market2-remote + cloud-market2-server + + + + + 17 + 17 + UTF-8 + + + + + +