系统配置
This commit is contained in:
@@ -6,6 +6,7 @@ import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.DependsOn;
|
||||
|
||||
|
||||
/**
|
||||
@@ -17,7 +18,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
@MapperScan("com.njcn.**.mapper")
|
||||
@EnableFeignClients(basePackages = "com.njcn")
|
||||
@SpringBootApplication(scanBasePackages = "com.njcn")
|
||||
@EnableMPP
|
||||
public class CsSystemBootApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.njcn.cssystem.controller.baseinfo;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.cssystem.pojo.param.AppBaseInformationAddParm;
|
||||
import com.njcn.cssystem.pojo.param.AppPersonSetAddParm;
|
||||
import com.njcn.cssystem.pojo.po.AppBaseInformationPO;
|
||||
import com.njcn.cssystem.pojo.po.AppPersonSetPO;
|
||||
import com.njcn.cssystem.pojo.vo.AppBaseInformationVO;
|
||||
import com.njcn.cssystem.service.AppBaseInformationService;
|
||||
import com.njcn.cssystem.service.AppPersonSetService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/4 9:02【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/appinfo")
|
||||
@Api(tags = "app信息")
|
||||
@AllArgsConstructor
|
||||
public class AppInfoController extends BaseController {
|
||||
|
||||
private final AppBaseInformationService appBaseInformationService;
|
||||
private final AppPersonSetService appPersonSetService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/addAppInfo")
|
||||
@ApiOperation("新增/更新app基础信息")
|
||||
@ApiImplicitParam(name = "AppBaseInformationAddParm", value = "新增app基础信息参数", required = true)
|
||||
public HttpResult<Boolean> addAppInfo(@RequestBody @Validated AppBaseInformationAddParm AppBaseInformationAddParm){
|
||||
String methodDescribe = getMethodDescribe("addAppInfo");
|
||||
AppBaseInformationPO appBaseInformationPO = new AppBaseInformationPO ();
|
||||
BeanUtils.copyProperties (AppBaseInformationAddParm, appBaseInformationPO);
|
||||
QueryWrapper<AppBaseInformationPO> query = new QueryWrapper();
|
||||
query.eq("type",AppBaseInformationAddParm.getType());
|
||||
boolean save =false;
|
||||
List<AppBaseInformationPO> list = appBaseInformationService.list(query);
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
appBaseInformationPO = list.get(0);
|
||||
appBaseInformationPO.setContent(AppBaseInformationAddParm.getContent());
|
||||
save = appBaseInformationService.updateById(appBaseInformationPO);
|
||||
}else{
|
||||
save = appBaseInformationService.save (appBaseInformationPO);
|
||||
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, save, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/addPersonSet")
|
||||
@ApiOperation("新增app个人中心信息")
|
||||
@ApiImplicitParam(name = "appPersonSetAddParm", value = "新增apppp个人中心信参数", required = true)
|
||||
public HttpResult<Boolean> addPersonSet(@RequestBody @Validated AppPersonSetAddParm appPersonSetAddParm){
|
||||
String methodDescribe = getMethodDescribe("addPersonSet");
|
||||
AppPersonSetPO appPersonSetPO = new AppPersonSetPO ();
|
||||
BeanUtils.copyProperties (appPersonSetAddParm, appPersonSetPO);
|
||||
appPersonSetPO.setStatus ("1");
|
||||
boolean save = appPersonSetService.save (appPersonSetPO);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, save, methodDescribe);
|
||||
}
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryPersonSet")
|
||||
@ApiOperation("查询app个人中心信息")
|
||||
public HttpResult<AppPersonSetPO> queryPersonSet(){
|
||||
String methodDescribe = getMethodDescribe("queryPersonSet");
|
||||
|
||||
List<AppPersonSetPO> list = appPersonSetService.list ( );
|
||||
AppPersonSetPO appPersonSetPO = list.stream ( ).filter (temp -> Objects.equals ("1", temp.getStatus ( ))).collect (Collectors.toList ( )).get (0);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, appPersonSetPO, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryAppInfo")
|
||||
@ApiOperation("查询app个人中心信息详情")
|
||||
public HttpResult<AppBaseInformationVO> queryPersonSet(@RequestParam("id")String id ){
|
||||
String methodDescribe = getMethodDescribe("queryPersonSet");
|
||||
AppBaseInformationVO appBaseInformationVO = new AppBaseInformationVO();
|
||||
AppBaseInformationPO byId = appBaseInformationService.getById (id);
|
||||
BeanUtils.copyProperties (byId,appBaseInformationVO);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, appBaseInformationVO, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryAppInfoByType")
|
||||
@ApiOperation("查询app个人中心信息详情")
|
||||
public HttpResult<AppBaseInformationVO> queryAppInfoByType(@RequestParam("type")String type ){
|
||||
String methodDescribe = getMethodDescribe("queryAppInfoByType");
|
||||
AppBaseInformationVO appBaseInformationVO = new AppBaseInformationVO();
|
||||
|
||||
AppBaseInformationPO byId = appBaseInformationService.getByType(type);
|
||||
BeanUtils.copyProperties (byId,appBaseInformationVO);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, appBaseInformationVO, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.cssystem.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.cssystem.pojo.po.AppBaseInformationPO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 19:17【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface AppBaseInformationMapper extends BaseMapper<AppBaseInformationPO> {
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.cssystem.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.cssystem.pojo.po.AppPersonSetPO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 19:17【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface AppPersonSetMapper extends BaseMapper<AppPersonSetPO> {
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.cssystem.mapper.AppPersonSetMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.cssystem.pojo.po.AppPersonSetPO">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table app_person_set-->
|
||||
<result column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="user_agreement" jdbcType="TINYINT" property="userAgreement" />
|
||||
<result column="system_introduction" jdbcType="TINYINT" property="systemIntroduction" />
|
||||
<result column="user_manual" jdbcType="TINYINT" property="userManual" />
|
||||
<result column="data_base" jdbcType="TINYINT" property="dataBase" />
|
||||
<result column="company_profile" jdbcType="TINYINT" property="companyProfile" />
|
||||
<result column="about_us" jdbcType="TINYINT" property="aboutUs" />
|
||||
<result column="status" jdbcType="BOOLEAN" property="status" />
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, user_agreement, system_introduction, user_manual, data_base, company_profile,
|
||||
about_us, `status`, create_by, create_time, update_by, update_time
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.cssystem.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.cssystem.pojo.po.AppBaseInformationPO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 19:17【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface AppBaseInformationService extends IService<AppBaseInformationPO>{
|
||||
|
||||
|
||||
AppBaseInformationPO getByType(String type);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.cssystem.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.cssystem.pojo.po.AppPersonSetPO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 19:17【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface AppPersonSetService extends IService<AppPersonSetPO>{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.njcn.cssystem.service.impl;
|
||||
|
||||
import com.njcn.cssystem.mapper.AppBaseInformationMapper;
|
||||
import com.njcn.cssystem.pojo.po.AppBaseInformationPO;
|
||||
import com.njcn.cssystem.service.AppBaseInformationService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 19:17【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class AppBaseInformationServiceImpl extends ServiceImpl<AppBaseInformationMapper, AppBaseInformationPO> implements AppBaseInformationService {
|
||||
|
||||
@Override
|
||||
public AppBaseInformationPO getByType(String type) {
|
||||
|
||||
return this.lambdaQuery().eq(AppBaseInformationPO::getType,type).one();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.cssystem.service.impl;
|
||||
|
||||
import com.njcn.cssystem.mapper.AppPersonSetMapper;
|
||||
import com.njcn.cssystem.pojo.po.AppPersonSetPO;
|
||||
import com.njcn.cssystem.service.AppPersonSetService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 19:17【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class AppPersonSetServiceImpl extends ServiceImpl<AppPersonSetMapper, AppPersonSetPO> implements AppPersonSetService {
|
||||
|
||||
}
|
||||
@@ -29,7 +29,7 @@ spring:
|
||||
shared-configs:
|
||||
- data-id: share-config.yaml
|
||||
refresh: true
|
||||
- data-Id: share-config-datasource-db.yaml
|
||||
- data-Id: algorithm-config.yaml
|
||||
refresh: true
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
|
||||
Reference in New Issue
Block a user