40 changed files with 1494 additions and 102 deletions
@ -1,37 +0,0 @@ |
|||
//package com.ccsens.ptos_open.api;
|
|||
//
|
|||
//import com.ccsens.cloudutil.annotation.MustLogin;
|
|||
//import com.ccsens.ptos_open.bean.dto.BusinessDto;
|
|||
//import com.ccsens.ptos_open.bean.vo.BusinessVo;
|
|||
//import com.ccsens.util.JsonResponse;
|
|||
//import com.ccsens.util.bean.dto.QueryDto;
|
|||
//import com.github.pagehelper.PageInfo;
|
|||
//import io.swagger.annotations.Api;
|
|||
//import io.swagger.annotations.ApiOperation;
|
|||
//import io.swagger.annotations.ApiParam;
|
|||
//import lombok.extern.slf4j.Slf4j;
|
|||
//import org.springframework.validation.annotation.Validated;
|
|||
//import org.springframework.web.bind.annotation.RequestBody;
|
|||
//import org.springframework.web.bind.annotation.RequestMapping;
|
|||
//import org.springframework.web.bind.annotation.RequestMethod;
|
|||
//import org.springframework.web.bind.annotation.RestController;
|
|||
//
|
|||
///**
|
|||
// * @author 逗
|
|||
// */
|
|||
//@RestController
|
|||
//@RequestMapping("/business")
|
|||
//public interface CcsensTestController {
|
|||
//
|
|||
//
|
|||
// @MustLogin
|
|||
// @ApiOperation(value = "查询业务列表", notes = "")
|
|||
// @RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
|
|||
// JsonResponse<PageInfo<BusinessVo.BusinessInfo>> queryBusiness(@ApiParam @Validated @RequestBody QueryDto<BusinessDto.QueryByPage> params);
|
|||
//
|
|||
// @MustLogin
|
|||
// @ApiOperation(value = "添加业务信息", notes = "")
|
|||
// @RequestMapping(value = "/save", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
|
|||
// JsonResponse saveBusiness(@ApiParam @Validated @RequestBody QueryDto<BusinessDto.SaveBusiness> params);
|
|||
//
|
|||
//}
|
@ -0,0 +1,30 @@ |
|||
//package com.ccsens.tall_sdk;
|
|||
//
|
|||
//import com.ccsens.cloudutil.ribbon.RibbonConfiguration;
|
|||
//import org.mybatis.spring.annotation.MapperScan;
|
|||
//import org.springframework.boot.SpringApplication;
|
|||
//import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
//import org.springframework.boot.web.servlet.ServletComponentScan;
|
|||
//import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
|
|||
//import org.springframework.cloud.openfeign.EnableFeignClients;
|
|||
//import org.springframework.context.annotation.ComponentScan;
|
|||
//import org.springframework.context.annotation.FilterType;
|
|||
//import org.springframework.scheduling.annotation.EnableAsync;
|
|||
//import org.springframework.scheduling.annotation.EnableScheduling;
|
|||
//
|
|||
//@MapperScan(basePackages = {"com.ccsens.ptos_tall.persist.*","com.ccsens.common.persist.*","com.ccsens.ptos_open.api.CcsensTestController"})
|
|||
//@ServletComponentScan
|
|||
//@EnableAsync
|
|||
//@EnableScheduling
|
|||
////开启断路器功能
|
|||
//@EnableCircuitBreaker
|
|||
//@EnableFeignClients(basePackages = "com.ccsens.cloudutil.feign")
|
|||
//@SpringBootApplication
|
|||
//@ComponentScan(basePackages = "com.ccsens", excludeFilters = { @ComponentScan.Filter(type= FilterType.ASSIGNABLE_TYPE, value = RibbonConfiguration.class)})
|
|||
//public class TallSdkApplication {
|
|||
//
|
|||
// public static void main(String[] args) {
|
|||
// SpringApplication.run(TallSdkApplication.class, args);
|
|||
// }
|
|||
//
|
|||
//}
|
@ -0,0 +1,32 @@ |
|||
//package com.ccsens.tall_sdk.api;
|
|||
//
|
|||
//import com.ccsens.util.JsonResponse;
|
|||
//import io.swagger.annotations.Api;
|
|||
//import io.swagger.annotations.ApiImplicitParams;
|
|||
//import io.swagger.annotations.ApiOperation;
|
|||
//import lombok.extern.slf4j.Slf4j;
|
|||
//import org.springframework.web.bind.annotation.RequestMapping;
|
|||
//import org.springframework.web.bind.annotation.RequestMethod;
|
|||
//import org.springframework.web.bind.annotation.RestController;
|
|||
//
|
|||
//import javax.servlet.http.HttpServletRequest;
|
|||
//
|
|||
///**
|
|||
// * @author 逗
|
|||
// */
|
|||
//@Api(tags = "DEBUG" , description = "DebugController | ")
|
|||
//@RestController
|
|||
//@RequestMapping("/debug")
|
|||
//@Slf4j
|
|||
//public class DebugController {
|
|||
//
|
|||
// @ApiOperation(value = "/测试",notes = "")
|
|||
// @ApiImplicitParams({
|
|||
// })
|
|||
// @RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
|
|||
// public JsonResponse debug(HttpServletRequest request) throws Exception {
|
|||
//
|
|||
// return JsonResponse.newInstance().ok("测试");
|
|||
// }
|
|||
//
|
|||
//}
|
@ -0,0 +1,28 @@ |
|||
package com.ccsens.tall_sdk.api; |
|||
|
|||
import com.ccsens.util.JsonResponse; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@Api(tags = "heartbeat" , description = "域信息相关接口") |
|||
@RestController |
|||
@RequestMapping("/tall") |
|||
@Slf4j |
|||
public class HeartbeatController { |
|||
|
|||
@ApiOperation(value = "接收私域的心跳", notes = "") |
|||
@RequestMapping(value = "/heart", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse receiveHeartbeat() throws Exception { |
|||
log.info("接受PTOS_TALL心跳后正确返回"); |
|||
return JsonResponse.newInstance().ok(); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,43 @@ |
|||
package com.ccsens.tall_sdk.api; |
|||
|
|||
import com.ccsens.cloudutil.annotation.MustLogin; |
|||
import com.ccsens.tall_sdk.bean.dto.ProjectDto; |
|||
import com.ccsens.tall_sdk.bean.vo.ProjectVo; |
|||
import com.ccsens.tall_sdk.service.ITallService; |
|||
import com.ccsens.util.JsonResponse; |
|||
import com.ccsens.util.bean.dto.QueryDto; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import io.swagger.annotations.ApiParam; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@Api(tags = "project" , description = "项目相关接口") |
|||
@RestController |
|||
@RequestMapping("/tall/project") |
|||
@Slf4j |
|||
public class ProjectController { |
|||
|
|||
@Resource |
|||
private ITallService tallService; |
|||
|
|||
@MustLogin |
|||
@ApiOperation(value = "日历页获取项目列表", notes = "") |
|||
@RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse<List<ProjectVo.ProjectInfo>> queryProjectByUser(@ApiParam @Validated @RequestBody QueryDto<ProjectDto.QueryProjectDto> params) throws Exception{ |
|||
log.info("查询用户所有域下所有业务内的所有项目:{}",params); |
|||
List<ProjectVo.ProjectInfo> projectInfoList = tallService.queryProjectByUser(params.getPhone(),params.getParam(),params.getUserId()); |
|||
log.info("返回用户所有域下所有业务内的所有项目"); |
|||
return JsonResponse.newInstance().ok(projectInfoList); |
|||
} |
|||
} |
@ -0,0 +1,42 @@ |
|||
package com.ccsens.tall_sdk.api; |
|||
|
|||
import com.ccsens.cloudutil.annotation.MustLogin; |
|||
import com.ccsens.tall_sdk.bean.dto.RoleDto; |
|||
import com.ccsens.tall_sdk.bean.vo.RoleVo; |
|||
import com.ccsens.tall_sdk.service.ITallService; |
|||
import com.ccsens.util.JsonResponse; |
|||
import com.ccsens.util.bean.dto.QueryDto; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import io.swagger.annotations.ApiParam; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.annotation.Resource; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@Api(tags = "角色相关" , description = "DebugController | ") |
|||
@RestController |
|||
@RequestMapping("/tall/role") |
|||
@Slf4j |
|||
public class RoleController { |
|||
|
|||
@Resource |
|||
private ITallService tallService; |
|||
|
|||
@MustLogin |
|||
@ApiOperation(value = "根据项目id查找角色", notes = "") |
|||
@RequestMapping(value = "/show", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse<RoleVo.QueryRole> queryByProjectId(@ApiParam @Validated @RequestBody QueryDto<RoleDto.QueryRoleById> params) { |
|||
log.info("根据项目id查找角色{}",params); |
|||
RoleVo.QueryRole queryRole = tallService.queryShowRole(params.getParam(), params.getUserId()); |
|||
log.info("项目id查找角色列表{}",queryRole); |
|||
return JsonResponse.newInstance().ok(queryRole); |
|||
} |
|||
} |
@ -0,0 +1,57 @@ |
|||
package com.ccsens.tall_sdk.api; |
|||
|
|||
import com.ccsens.cloudutil.annotation.MustLogin; |
|||
import com.ccsens.tall_sdk.bean.dto.TaskDto; |
|||
import com.ccsens.tall_sdk.bean.vo.TaskVo; |
|||
import com.ccsens.tall_sdk.service.ITallService; |
|||
import com.ccsens.util.JsonResponse; |
|||
import com.ccsens.util.bean.dto.QueryDto; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import io.swagger.annotations.ApiParam; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@Api(tags = "任务相关" , description = "DebugController | ") |
|||
@RestController |
|||
@RequestMapping("/tall/task") |
|||
@Slf4j |
|||
public class TaskController { |
|||
|
|||
@Resource |
|||
private ITallService tallService; |
|||
|
|||
@MustLogin |
|||
@ApiOperation(value = "查找永久日常任务", notes = "") |
|||
@RequestMapping(value = "/permanent", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse<List<TaskVo.QueryTask>> queryPermanentGlobalTask(@ApiParam @Validated @RequestBody QueryDto<TaskDto.QueryPermanentGlobalTask> params) { |
|||
List<TaskVo.QueryTask> queryTasks = tallService.queryPermanentGlobalTask(params.getParam(), params.getUserId()); |
|||
return JsonResponse.newInstance().ok(queryTasks); |
|||
} |
|||
|
|||
@MustLogin |
|||
@ApiOperation(value = "查找带时间的日常任务", notes = "") |
|||
@RequestMapping(value = "/global", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse<List<TaskVo.QueryTask>> queryGlobalTask(@ApiParam @Validated @RequestBody QueryDto<TaskDto.QueryGlobalTask> params) { |
|||
List<TaskVo.QueryTask> queryTasks = tallService.queryGlobalTask(params.getParam(), params.getUserId()); |
|||
return JsonResponse.newInstance().ok(queryTasks); |
|||
} |
|||
|
|||
@MustLogin |
|||
@ApiOperation(value = "查找定期任务", notes = "") |
|||
@RequestMapping(value = "/regular", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse<List<TaskVo.QueryTask>> queryRegularTask(@ApiParam @Validated @RequestBody QueryDto<TaskDto.QueryRegularTask> params) { |
|||
List<TaskVo.QueryTask> queryTasks = tallService.queryRegularTask(params.getParam(), params.getUserId()); |
|||
return JsonResponse.newInstance().ok(queryTasks); |
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.ccsens.tall_sdk.bean.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@Data |
|||
public class ProjectDto { |
|||
|
|||
@Data |
|||
@ApiModel("用户查询可见的项目") |
|||
public static class QueryProjectDto{ |
|||
@ApiModelProperty("开始时间") |
|||
private Long startTime; |
|||
@ApiModelProperty("结束时间") |
|||
private Long endTime; |
|||
} |
|||
|
|||
|
|||
@Data |
|||
@ApiModel("查询日历是否有项目") |
|||
public static class QueryHaveProject { |
|||
@NotNull(message = "开始时间不能为空") |
|||
@ApiModelProperty("开始时间") |
|||
private Long startTime; |
|||
@NotNull(message = "结束时间不能为空") |
|||
@ApiModelProperty("结束时间") |
|||
private Long endTime; |
|||
} |
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.ccsens.tall_sdk.bean.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
|
|||
@Data |
|||
public class RoleDto { |
|||
@Data |
|||
@ApiModel("查看角色栏展示") |
|||
public static class QueryRoleById{ |
|||
@NotNull(message = "项目id不能为空") |
|||
@ApiModelProperty("项目id") |
|||
private Long projectId; |
|||
@ApiModelProperty("展示的角色数量") |
|||
private int num = 5; |
|||
} |
|||
} |
@ -0,0 +1,46 @@ |
|||
package com.ccsens.tall_sdk.bean.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
|
|||
@Data |
|||
public class TaskDto { |
|||
@Data |
|||
@ApiModel("查看永久日常任务") |
|||
public static class QueryPermanentGlobalTask{ |
|||
@NotNull(message = "角色id不能为空") |
|||
@ApiModelProperty("角色id") |
|||
private Long roleId; |
|||
} |
|||
|
|||
@Data |
|||
@ApiModel("查看带时间的日常任务") |
|||
public static class QueryGlobalTask{ |
|||
@NotNull(message = "角色id不能为空") |
|||
@ApiModelProperty("角色id") |
|||
private Long roleId; |
|||
@ApiModelProperty("时间基准点 默认当前") |
|||
private Long timeNode = System.currentTimeMillis(); |
|||
@ApiModelProperty("时间颗粒度单位 默认天") |
|||
private int timeUnit = 4; |
|||
} |
|||
|
|||
@Data |
|||
@ApiModel("查看定期任务") |
|||
public static class QueryRegularTask{ |
|||
@NotNull(message = "角色id不能为空") |
|||
@ApiModelProperty("角色id") |
|||
private Long roleId; |
|||
@ApiModelProperty("时间基准点 默认当前") |
|||
private Long timeNode = System.currentTimeMillis(); |
|||
@ApiModelProperty("时间颗粒度 默认天") |
|||
private int timeUnit = 4; |
|||
@ApiModelProperty("0向上查找 1向下查找(默认) 下查包含自己,上查不包含") |
|||
private int queryType = 1; |
|||
@ApiModelProperty("查找颗粒度数量 默认3个") |
|||
private int queryNum = 3; |
|||
} |
|||
} |
@ -0,0 +1,103 @@ |
|||
package com.ccsens.tall_sdk.bean.vo; |
|||
|
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.ccsens.util.WebConstant; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@Data |
|||
public class ProjectVo { |
|||
|
|||
@Data |
|||
@ApiModel("域信息") |
|||
public static class DomainInfo{ |
|||
@ApiModelProperty("id") |
|||
private Long id; |
|||
@ApiModelProperty("域名") |
|||
private String name; |
|||
@ApiModelProperty("域code") |
|||
private String code; |
|||
@ApiModelProperty("域访问前缀") |
|||
private String url; |
|||
@ApiModelProperty("是否是自身 0否 1是") |
|||
private byte self; |
|||
@ApiModelProperty("业务列表") |
|||
private List<BusinessInfo> businessList; |
|||
} |
|||
@Data |
|||
@ApiModel("业务信息") |
|||
public static class BusinessInfo{ |
|||
@ApiModelProperty("业务id") |
|||
private Long businessId; |
|||
@ApiModelProperty("业务名") |
|||
private String businessName; |
|||
@ApiModelProperty("业务code") |
|||
private String businessCode; |
|||
@ApiModelProperty("业务访问前缀") |
|||
private String url; |
|||
@ApiModelProperty("项目列表") |
|||
private List<ProjectInfo> projectList; |
|||
} |
|||
|
|||
@Data |
|||
@ApiModel("日历下项目列表信息") |
|||
public static class ProjectInfo{ |
|||
@ApiModelProperty("id") |
|||
private Long id; |
|||
@ApiModelProperty("项目名") |
|||
private String name; |
|||
@ApiModelProperty("开始时间") |
|||
private Long startTime; |
|||
@ApiModelProperty("结束时间") |
|||
private Long endTime; |
|||
@ApiModelProperty("项目完成状态(0-未开始,1-进行中,2-暂停,3-已完成)") |
|||
private byte status; |
|||
@ApiModelProperty("访问路径)") |
|||
private String url; |
|||
@ApiModelProperty("所属域code") |
|||
private String domainCode; |
|||
@ApiModelProperty("所属业务code") |
|||
private String businessCode; |
|||
@ApiModelProperty("子项目") |
|||
private List<ProjectInfo> sonProjectList; |
|||
@JsonIgnore |
|||
@ApiModelProperty("父级id") |
|||
private Long parentId; |
|||
|
|||
public Byte getStatus() { |
|||
long current = System.currentTimeMillis(); |
|||
if(ObjectUtil.isNull(getStartTime()) || ObjectUtil.isNull(getEndTime())) { |
|||
return null; |
|||
} |
|||
if(getStartTime() > current){ |
|||
this.status = (byte) WebConstant.EVENT_PROCESS.Pending.value; |
|||
}else if(getEndTime() < current){ |
|||
this.status = (byte) WebConstant.EVENT_PROCESS.Expired.value; |
|||
}else{ |
|||
this.status = (byte) WebConstant.EVENT_PROCESS.Processing.value; |
|||
} |
|||
return this.status; |
|||
} |
|||
|
|||
public ProjectInfo() { |
|||
} |
|||
|
|||
public ProjectInfo(Long id, String name, Long startTime, Long endTime, String url, String domainCode, String businessCode) { |
|||
this.id = id; |
|||
this.name = name; |
|||
this.startTime = startTime; |
|||
this.endTime = endTime; |
|||
this.url = url; |
|||
this.domainCode = domainCode; |
|||
this.businessCode = businessCode; |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.ccsens.tall_sdk.bean.vo; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class RoleVo { |
|||
|
|||
@Data |
|||
@ApiModel("查看角色栏展示的角色信息") |
|||
public static class QueryRole { |
|||
@ApiModelProperty("展示的角色信息") |
|||
private List<RoleInfo> visibleList; |
|||
@ApiModelProperty("不展示的角色信息") |
|||
private List<RoleInfo> invisibleList; |
|||
} |
|||
|
|||
@Data |
|||
@ApiModel("角色信息") |
|||
public static class RoleInfo { |
|||
@ApiModelProperty("角色id") |
|||
private Long id; |
|||
@ApiModelProperty("是否是项目经理 0否 1是") |
|||
private int pm; |
|||
@ApiModelProperty("是否是自己所属的角色 0否 1是") |
|||
private int mine; |
|||
@ApiModelProperty("角色名") |
|||
private String name; |
|||
@ApiModelProperty("排序") |
|||
private int sequence; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,97 @@ |
|||
package com.ccsens.tall_sdk.bean.vo; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class TaskVo { |
|||
|
|||
@Data |
|||
@ApiModel("查看定期任务返回值") |
|||
public static class QueryTask{ |
|||
@ApiModelProperty("任务id(任务分解id)") |
|||
private Long id; |
|||
@ApiModelProperty("详情id") |
|||
private Long detailId; |
|||
@ApiModelProperty("任务名") |
|||
private String name; |
|||
@ApiModelProperty("任务详情") |
|||
private String description; |
|||
@ApiModelProperty("计划开始时间") |
|||
private Long planStart; |
|||
@ApiModelProperty("计划时长") |
|||
private Long planDuration; |
|||
@ApiModelProperty("计划结束时长") |
|||
private Long planEnd; |
|||
@ApiModelProperty("实际开始时间") |
|||
private Long realStart; |
|||
@ApiModelProperty("实际时长") |
|||
private Long realDuration; |
|||
@ApiModelProperty("实际结束时长") |
|||
private Long realEnd; |
|||
@ApiModelProperty("任务状态 0未开始 1进行中 2暂停中 3已完成") |
|||
private int process; |
|||
@ApiModelProperty("任务流转策略 -1不跳转 0直接跳转 如果是其他正整数 就是多少毫秒后跳转 ") |
|||
private Long skip; |
|||
@ApiModelProperty("跳转的任务id") |
|||
private Long skipTaskId; |
|||
@ApiModelProperty("任务面板") |
|||
private PanelInfo panel; |
|||
@ApiModelProperty("检查人列表") |
|||
private List<CheckerOfTask> checkerList; |
|||
@ApiModelProperty("插件") |
|||
private List<List<TaskPluginInfo>> plugins; |
|||
} |
|||
@Data |
|||
@ApiModel("任务下的检查人") |
|||
public static class CheckerOfTask { |
|||
@ApiModelProperty("角色id") |
|||
private Long roleId; |
|||
@ApiModelProperty("名字") |
|||
private String name; |
|||
} |
|||
|
|||
@Data |
|||
@ApiModel("任务面板信息") |
|||
public static class PanelInfo{ |
|||
@ApiModelProperty("背景色") |
|||
private String backgroundColor; |
|||
@ApiModelProperty("圆角") |
|||
private String borderRadius; |
|||
@ApiModelProperty("边框") |
|||
private String border; |
|||
@ApiModelProperty("阴影") |
|||
private String shadow; |
|||
@ApiModelProperty("宽") |
|||
private String width; |
|||
@ApiModelProperty("高") |
|||
private String height; |
|||
@ApiModelProperty("行") |
|||
private int row; |
|||
@ApiModelProperty("列") |
|||
private int col; |
|||
} |
|||
|
|||
@Data |
|||
@ApiModel("任务下的插件信息") |
|||
public static class TaskPluginInfo{ |
|||
@ApiModelProperty("插件任务关联id") |
|||
private Long pluginTaskId; |
|||
@ApiModelProperty("插件id") |
|||
private Long pluginId; |
|||
@ApiModelProperty("参数") |
|||
private String param; |
|||
@ApiModelProperty("行") |
|||
private int row; |
|||
@ApiModelProperty("列") |
|||
private int col; |
|||
@ApiModelProperty("跨行") |
|||
private int rowspan; |
|||
@ApiModelProperty("跨列") |
|||
private int colspan; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
//package com.ccsens.tall_sdk.config;
|
|||
//
|
|||
//import com.ccsens.tall_sdk.intercept.MybatisInterceptor;
|
|||
//import org.springframework.context.annotation.Bean;
|
|||
//import org.springframework.context.annotation.Configuration;
|
|||
//
|
|||
///**
|
|||
// * @description:
|
|||
// * @author: wuHuiJuan
|
|||
// * @create: 2019/12/03 18:01
|
|||
// */
|
|||
//@Configuration
|
|||
//public class BeanConfig {
|
|||
// /**
|
|||
// * 注册拦截器
|
|||
// */
|
|||
// @Bean
|
|||
// public MybatisInterceptor mybatisInterceptor() {
|
|||
// MybatisInterceptor interceptor = new MybatisInterceptor();
|
|||
// return interceptor;
|
|||
// }
|
|||
//}
|
@ -0,0 +1,128 @@ |
|||
//package com.ccsens.tall_sdk.config;
|
|||
//
|
|||
//
|
|||
//import cn.hutool.core.lang.Snowflake;
|
|||
//import cn.hutool.core.util.IdUtil;
|
|||
//import com.ccsens.util.config.DruidProps;
|
|||
//import com.fasterxml.jackson.databind.DeserializationFeature;
|
|||
//import com.fasterxml.jackson.databind.ObjectMapper;
|
|||
//import com.fasterxml.jackson.databind.module.SimpleModule;
|
|||
//import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
|||
//import org.springframework.beans.factory.annotation.Value;
|
|||
//import org.springframework.context.annotation.Bean;
|
|||
//import org.springframework.context.annotation.Configuration;
|
|||
//import org.springframework.http.MediaType;
|
|||
//import org.springframework.http.converter.HttpMessageConverter;
|
|||
//import org.springframework.http.converter.StringHttpMessageConverter;
|
|||
//import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
|||
//import org.springframework.web.servlet.config.annotation.*;
|
|||
//
|
|||
//import javax.annotation.Resource;
|
|||
//import javax.sql.DataSource;
|
|||
//import java.nio.charset.Charset;
|
|||
//import java.util.ArrayList;
|
|||
//import java.util.List;
|
|||
//import java.util.TimeZone;
|
|||
//
|
|||
//@Configuration
|
|||
//public class SpringConfig implements WebMvcConfigurer {
|
|||
// @Resource
|
|||
// private DruidProps druidPropsUtil;
|
|||
// @Value("${spring.snowflake.workerId}")
|
|||
// private String workerId;
|
|||
// @Value("${spring.snowflake.datacenterId}")
|
|||
// private String datacenterId;
|
|||
//
|
|||
// /**
|
|||
// * 配置Converter
|
|||
// * @return
|
|||
// */
|
|||
// @Bean
|
|||
// public HttpMessageConverter<String> responseStringConverter() {
|
|||
// StringHttpMessageConverter converter = new StringHttpMessageConverter(
|
|||
// Charset.forName("UTF-8"));
|
|||
// return converter;
|
|||
// }
|
|||
//
|
|||
// @Bean
|
|||
// public HttpMessageConverter<Object> responseJsonConverter(){
|
|||
// MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
|
|||
// List<MediaType> mediaTypeList = new ArrayList<>();
|
|||
// mediaTypeList.add(MediaType.TEXT_HTML);
|
|||
// mediaTypeList.add(MediaType.APPLICATION_JSON_UTF8);
|
|||
// converter.setSupportedMediaTypes(mediaTypeList);
|
|||
//
|
|||
// ObjectMapper objectMapper = new ObjectMapper();
|
|||
// SimpleModule simpleModule = new SimpleModule();
|
|||
// simpleModule.addSerializer(Long.class, ToStringSerializer.instance);
|
|||
// simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance);
|
|||
// objectMapper.registerModule(simpleModule);
|
|||
// objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
|||
// objectMapper.setTimeZone(TimeZone.getTimeZone("GMT+8"));
|
|||
// converter.setObjectMapper(objectMapper);
|
|||
//
|
|||
// return converter;
|
|||
// }
|
|||
//
|
|||
// @Override
|
|||
// public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
|||
// converters.add(responseStringConverter());
|
|||
// converters.add(responseJsonConverter());
|
|||
// }
|
|||
//
|
|||
// @Override
|
|||
// public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
|
|||
// configurer.favorPathExtension(false);
|
|||
// }
|
|||
//
|
|||
// @Override
|
|||
// public void addCorsMappings(CorsRegistry registry) {
|
|||
// registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
|
|||
//// .allowedMethods("*") // 允许提交请求的方法,*表示全部允许
|
|||
// .allowedOrigins("*") // #允许向该服务器提交请求的URI,*表示全部允许
|
|||
// .allowCredentials(true) // 允许cookies跨域
|
|||
// .allowedHeaders("*") // #允许访问的头信息,*表示全部
|
|||
// .maxAge(18000L); // 预检请求的缓存时间(秒),即在这个时间段里,对于相同的跨域请求不会再预检了
|
|||
//
|
|||
// }
|
|||
//
|
|||
//
|
|||
//
|
|||
//
|
|||
// /**
|
|||
// * 配置静态资源
|
|||
// */
|
|||
// @Override
|
|||
// public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|||
// registry.addResourceHandler("swagger-ui.html")
|
|||
// .addResourceLocations("classpath:/META-INF/resources/");
|
|||
// registry.addResourceHandler("/webjars/**")
|
|||
// .addResourceLocations("classpath:/META-INF/resources/webjars/");
|
|||
//
|
|||
// registry.addResourceHandler("/uploads/**")
|
|||
// .addResourceLocations("file:///home/ptos_tall/server//uploads/");
|
|||
// }
|
|||
//
|
|||
// /**
|
|||
// * 配置拦截器
|
|||
// * @param registry
|
|||
// */
|
|||
// @Override
|
|||
// public void addInterceptors(InterceptorRegistry registry) {
|
|||
//
|
|||
// }
|
|||
//
|
|||
//
|
|||
// /**
|
|||
// * 配置数据源(单数据源)
|
|||
// */
|
|||
// @Bean
|
|||
// public DataSource dataSource(){
|
|||
// return druidPropsUtil.createDruidDataSource();
|
|||
// }
|
|||
//
|
|||
// @Bean
|
|||
// public Snowflake snowflake(){
|
|||
// return IdUtil.createSnowflake(Long.valueOf(workerId), Long.valueOf(datacenterId));
|
|||
// }
|
|||
//}
|
@ -0,0 +1,56 @@ |
|||
//package com.ccsens.tall_sdk.config;
|
|||
//
|
|||
//import com.ccsens.util.WebConstant;
|
|||
//import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
|||
//import org.springframework.context.annotation.Bean;
|
|||
//import org.springframework.context.annotation.Configuration;
|
|||
//import springfox.documentation.builders.ParameterBuilder;
|
|||
//import springfox.documentation.builders.RequestHandlerSelectors;
|
|||
//import springfox.documentation.schema.ModelRef;
|
|||
//import springfox.documentation.service.ApiInfo;
|
|||
//import springfox.documentation.service.Parameter;
|
|||
//import springfox.documentation.spi.DocumentationType;
|
|||
//import springfox.documentation.spring.web.plugins.Docket;
|
|||
//import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
|||
//
|
|||
//import java.util.ArrayList;
|
|||
//import java.util.List;
|
|||
//
|
|||
//@Configuration
|
|||
//@EnableSwagger2
|
|||
//@ConditionalOnExpression("${swagger.enable}")
|
|||
////public class SwaggerConfigure extends WebMvcConfigurationSupport {
|
|||
//public class SwaggerConfigure /*implements WebMvcConfigurer*/ {
|
|||
// @Bean
|
|||
// public Docket customDocket() {
|
|||
// //
|
|||
// return new Docket(DocumentationType.SWAGGER_2)
|
|||
// .apiInfo(apiInfo())
|
|||
// .select()
|
|||
// .apis(RequestHandlerSelectors
|
|||
// .basePackage("com.ccsens.ptos_tall.api"))
|
|||
// .build()
|
|||
// .globalOperationParameters(setHeaderToken());
|
|||
// }
|
|||
//
|
|||
// private ApiInfo apiInfo() {
|
|||
// return new ApiInfo("Swagger Tall-game",//大标题 title
|
|||
// "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",//小标题
|
|||
// "1.0.0",//版本
|
|||
// "http://swagger.io/terms/",//termsOfServiceUrl
|
|||
// "zhangsan",//作者
|
|||
// "Apache 2.0",//链接显示文字
|
|||
// "http://www.apache.org/licenses/LICENSE-2.0.html"//网站链接
|
|||
// );
|
|||
// }
|
|||
//
|
|||
// private List<Parameter> setHeaderToken() {
|
|||
// ParameterBuilder tokenPar = new ParameterBuilder();
|
|||
// List<Parameter> pars = new ArrayList<>();
|
|||
// tokenPar.name(WebConstant.HEADER_KEY_TOKEN).description("token")
|
|||
// .defaultValue(WebConstant.HEADER_KEY_TOKEN_PREFIX)
|
|||
// .modelRef(new ModelRef("string")).parameterType("header").required(false).build();
|
|||
// pars.add(tokenPar.build());
|
|||
// return pars;
|
|||
// }
|
|||
//}
|
@ -0,0 +1,159 @@ |
|||
package com.ccsens.tall_sdk.intercept; |
|||
|
|||
import cn.hutool.core.collection.CollectionUtil; |
|||
import com.ccsens.util.WebConstant; |
|||
import org.apache.ibatis.executor.Executor; |
|||
import org.apache.ibatis.mapping.BoundSql; |
|||
import org.apache.ibatis.mapping.MappedStatement; |
|||
import org.apache.ibatis.mapping.ResultMap; |
|||
import org.apache.ibatis.mapping.SqlSource; |
|||
import org.apache.ibatis.plugin.*; |
|||
import org.apache.ibatis.reflection.DefaultReflectorFactory; |
|||
import org.apache.ibatis.reflection.MetaObject; |
|||
import org.apache.ibatis.reflection.factory.DefaultObjectFactory; |
|||
import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory; |
|||
import org.apache.ibatis.session.ResultHandler; |
|||
import org.apache.ibatis.session.RowBounds; |
|||
|
|||
import java.lang.reflect.InvocationTargetException; |
|||
import java.lang.reflect.Method; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Properties; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: wuHuiJuan |
|||
* @create: 2019/12/11 10:58 |
|||
*/ |
|||
@Intercepts({ |
|||
@Signature( |
|||
type = Executor.class, |
|||
method = "query", |
|||
args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class} |
|||
) |
|||
}) |
|||
public class MybatisInterceptor implements Interceptor { |
|||
@Override |
|||
public Object intercept(Invocation invocation) throws Throwable { |
|||
|
|||
|
|||
String selectByExample = "selectByExample"; |
|||
String countByExample = "countByExample"; |
|||
String countByExample2 = "selectByExample_COUNT"; |
|||
String selectByPrimaryKey = "selectByPrimaryKey"; |
|||
|
|||
Object[] args = invocation.getArgs(); |
|||
MappedStatement statement = (MappedStatement) args[0]; |
|||
if (statement.getId().endsWith(selectByExample) |
|||
|| statement.getId().endsWith(countByExample) |
|||
|| statement.getId().endsWith(countByExample2)) { |
|||
//XXXExample
|
|||
Object example = args[1]; |
|||
|
|||
addCondition(statement, example); |
|||
|
|||
|
|||
|
|||
|
|||
} else if (statement.getId().endsWith(selectByPrimaryKey)) { |
|||
BoundSql boundSql = statement.getBoundSql(args[1]); |
|||
String sql = boundSql.getSql() + " and rec_status = 0"; |
|||
MappedStatement newStatement = newMappedStatement(statement, new BoundSqlSqlSource(boundSql)); |
|||
MetaObject msObject = MetaObject.forObject(newStatement, new DefaultObjectFactory(), new DefaultObjectWrapperFactory(),new DefaultReflectorFactory()); |
|||
msObject.setValue("sqlSource.boundSql.sql", sql); |
|||
args[0] = newStatement; |
|||
} |
|||
|
|||
return invocation.proceed(); |
|||
} |
|||
|
|||
private void addCondition(MappedStatement statement, Object example) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException { |
|||
if (example instanceof Map) { |
|||
example = ((Map) example).get("_ORIGINAL_PARAMETER_OBJECT"); |
|||
} |
|||
|
|||
|
|||
Method method = example.getClass().getMethod("getOredCriteria", null); |
|||
//获取到条件数组,第一个是Criteria
|
|||
List list = (List) method.invoke(example); |
|||
if (CollectionUtil.isEmpty(list)) { |
|||
Class clazz = ((ResultMap) statement.getResultMaps().get(0)).getType(); |
|||
String exampleName = clazz.getName() + "Example"; |
|||
Object paramExample = Class.forName(exampleName).newInstance(); |
|||
Method createCriteria = paramExample.getClass().getMethod("createCriteria"); |
|||
Object criteria = createCriteria.invoke(paramExample); |
|||
Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); |
|||
andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); |
|||
list.add(criteria); |
|||
} else { |
|||
Object criteria = list.get(0); |
|||
Method getCriteria = criteria.getClass().getMethod("getCriteria"); |
|||
List params = (List) getCriteria.invoke(criteria); |
|||
boolean hasDel = false; |
|||
for (Object param : params) { |
|||
Method getCondition = param.getClass().getMethod("getCondition"); |
|||
Object condition = getCondition.invoke(param); |
|||
if ("rec_status =".equals(condition)) { |
|||
hasDel = true; |
|||
} |
|||
} |
|||
if (!hasDel) { |
|||
Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); |
|||
andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); |
|||
} |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public Object plugin(Object target) { |
|||
return Plugin.wrap(target, this); |
|||
} |
|||
|
|||
@Override |
|||
public void setProperties(Properties properties) { |
|||
|
|||
} |
|||
|
|||
private MappedStatement newMappedStatement(MappedStatement ms, SqlSource newSqlSource) { |
|||
MappedStatement.Builder builder = |
|||
new MappedStatement.Builder(ms.getConfiguration(), ms.getId(), newSqlSource, ms.getSqlCommandType()); |
|||
builder.resource(ms.getResource()); |
|||
builder.fetchSize(ms.getFetchSize()); |
|||
builder.statementType(ms.getStatementType()); |
|||
builder.keyGenerator(ms.getKeyGenerator()); |
|||
if (ms.getKeyProperties() != null && ms.getKeyProperties().length != 0) { |
|||
StringBuilder keyProperties = new StringBuilder(); |
|||
for (String keyProperty : ms.getKeyProperties()) { |
|||
keyProperties.append(keyProperty).append(","); |
|||
} |
|||
keyProperties.delete(keyProperties.length() - 1, keyProperties.length()); |
|||
builder.keyProperty(keyProperties.toString()); |
|||
} |
|||
builder.timeout(ms.getTimeout()); |
|||
builder.parameterMap(ms.getParameterMap()); |
|||
builder.resultMaps(ms.getResultMaps()); |
|||
builder.resultSetType(ms.getResultSetType()); |
|||
builder.cache(ms.getCache()); |
|||
builder.flushCacheRequired(ms.isFlushCacheRequired()); |
|||
builder.useCache(ms.isUseCache()); |
|||
|
|||
return builder.build(); |
|||
} |
|||
|
|||
|
|||
// 定义一个内部辅助类,作用是包装sq
|
|||
class BoundSqlSqlSource implements SqlSource { |
|||
private BoundSql boundSql; |
|||
public BoundSqlSqlSource(BoundSql boundSql) { |
|||
this.boundSql = boundSql; |
|||
} |
|||
@Override |
|||
public BoundSql getBoundSql(Object parameterObject) { |
|||
return boundSql; |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,56 @@ |
|||
package com.ccsens.tall_sdk.service; |
|||
|
|||
import com.ccsens.tall_sdk.bean.dto.ProjectDto; |
|||
import com.ccsens.tall_sdk.bean.dto.RoleDto; |
|||
import com.ccsens.tall_sdk.bean.dto.TaskDto; |
|||
import com.ccsens.tall_sdk.bean.vo.ProjectVo; |
|||
import com.ccsens.tall_sdk.bean.vo.RoleVo; |
|||
import com.ccsens.tall_sdk.bean.vo.TaskVo; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
public interface ITallService { |
|||
/** |
|||
* 查询用户可见的项目 |
|||
* @param phone 用户手机号 |
|||
* @param param 开始结束时间 |
|||
* @param userId userId |
|||
* @return 返回项目列表 |
|||
*/ |
|||
List<ProjectVo.ProjectInfo> queryProjectByUser(String phone, ProjectDto.QueryProjectDto param, Long userId); |
|||
|
|||
/** |
|||
* 查询项目下的角色列表 |
|||
* @param param 项目id |
|||
* @param userId userId |
|||
* @return 返回角色列表 |
|||
*/ |
|||
RoleVo.QueryRole queryShowRole(RoleDto.QueryRoleById param, Long userId); |
|||
|
|||
/** |
|||
* 查询没有时间的日常任务 |
|||
* @param param 角色id等。。。 |
|||
* @param userId userId |
|||
* @return 返回任务列表 |
|||
*/ |
|||
List<TaskVo.QueryTask> queryPermanentGlobalTask(TaskDto.QueryPermanentGlobalTask param, Long userId); |
|||
|
|||
/** |
|||
* 查询有时间的日常任务 |
|||
* @param param 角色id和时间 |
|||
* @param userId userId |
|||
* @return 返回任务列表 |
|||
*/ |
|||
List<TaskVo.QueryTask> queryGlobalTask(TaskDto.QueryGlobalTask param, Long userId); |
|||
|
|||
/** |
|||
* 查询定期任务 |
|||
* @param param 角色id和时间 |
|||
* @param userId userId |
|||
* @return 返回任务列表 |
|||
*/ |
|||
List<TaskVo.QueryTask> queryRegularTask(TaskDto.QueryRegularTask param, Long userId); |
|||
} |
@ -0,0 +1,30 @@ |
|||
logging: |
|||
level: |
|||
com: |
|||
favorites: DEBUG |
|||
org: |
|||
hibernate: ERROR |
|||
springframework: |
|||
web: DEBUG |
|||
mybatis: |
|||
config-location: classpath:mybatis/mybatis-config.xml |
|||
mapper-locations: classpath*:mapper_*/*.xml |
|||
# type-aliases-package: com.ccsens.mtpro.bean |
|||
#server: |
|||
# tomcat: |
|||
# uri-encoding: UTF-8 |
|||
spring: |
|||
http: |
|||
encoding: |
|||
charset: UTF-8 |
|||
enabled: true |
|||
force: true |
|||
log-request-details: true |
|||
servlet: |
|||
multipart: |
|||
max-file-size: 10MB |
|||
max-request-size: 100MB |
|||
snowflake: |
|||
datacenterId: 10 |
|||
workerId: 1 |
|||
|
@ -0,0 +1,51 @@ |
|||
server: |
|||
port: 7301 |
|||
servlet: |
|||
context-path: |
|||
spring: |
|||
application: |
|||
name: sdk |
|||
datasource: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
# rabbitmq: |
|||
# host: 192.168.0.99 |
|||
# password: 111111 |
|||
# port: 5672 |
|||
# username: admin |
|||
rabbitmq: |
|||
host: dd.tall.wiki |
|||
password: 111111 |
|||
port: 5672 |
|||
username: admin |
|||
redis: |
|||
database: 0 |
|||
host: 127.0.0.1 |
|||
jedis: |
|||
pool: |
|||
max-active: 200 |
|||
max-idle: 10 |
|||
max-wait: -1ms |
|||
min-idle: 0 |
|||
password: '' |
|||
port: 6379 |
|||
timeout: 1000ms |
|||
swagger: |
|||
enable: true |
|||
mybatisCache: |
|||
database: 1 |
|||
host: 127.0.0.1 |
|||
jedis: |
|||
pool: |
|||
max-active: 200 |
|||
max-idle: 10 |
|||
max-wait: -1 |
|||
min-idle: 0 |
|||
password: '' |
|||
port: 6379 |
|||
timeout: 1000 |
|||
|
|||
smsCode: 0 |
|||
file: |
|||
path: /home/ptos_tall/server//uploads/ |
|||
domain: https://test.tall.wiki/gateway/ptostall |
|||
imgDomain: https://test.tall.wiki/gateway/ptostall/uploads/ |
@ -0,0 +1,41 @@ |
|||
server: |
|||
port: 7290 |
|||
servlet: |
|||
context-path: |
|||
spring: |
|||
application: |
|||
name: ptostall |
|||
datasource: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
rabbitmq: |
|||
host: 121.36.3.207 |
|||
password: 111111 |
|||
port: 5672 |
|||
username: admin |
|||
redis: |
|||
database: 0 |
|||
host: 127.0.0.1 |
|||
jedis: |
|||
pool: |
|||
max-active: 200 |
|||
max-idle: 10 |
|||
max-wait: -1ms |
|||
min-idle: 0 |
|||
password: '' |
|||
# password: 'areowqr!@43ef' |
|||
port: 6379 |
|||
timeout: 1000ms |
|||
swagger: |
|||
enable: true |
|||
eureka: |
|||
instance: |
|||
ip-address: 101.201.226.21 |
|||
|
|||
gatewayUrl: https://www.tall.wiki/gateway/ |
|||
notGatewayUrl: https://www.tall.wiki/ |
|||
apiUrl: https://www.tall.wiki/ |
|||
smsCode: 0 |
|||
file: |
|||
path: /home/ptos_tall/server//uploads/ |
|||
domain: https://www.tall.wiki/gateway/ptos_tall |
|||
imgDomain: https://www.tall.wiki/gateway/ptos_tall/uploads/ |
@ -0,0 +1,49 @@ |
|||
server: |
|||
port: 7290 |
|||
servlet: |
|||
context-path: |
|||
spring: |
|||
application: |
|||
name: ptostall |
|||
datasource: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
rabbitmq: |
|||
host: dd.tall.wiki |
|||
password: 111111 |
|||
port: 5672 |
|||
username: admin |
|||
redis: |
|||
database: 0 |
|||
host: 127.0.0.1 |
|||
jedis: |
|||
pool: |
|||
max-active: 200 |
|||
max-idle: 10 |
|||
max-wait: -1ms |
|||
min-idle: 0 |
|||
password: '' |
|||
port: 6379 |
|||
timeout: 1000ms |
|||
swagger: |
|||
enable: true |
|||
mybatisCache: |
|||
database: 1 |
|||
host: 127.0.0.1 |
|||
jedis: |
|||
pool: |
|||
max-active: 200 |
|||
max-idle: 10 |
|||
max-wait: -1 |
|||
min-idle: 0 |
|||
password: '' |
|||
port: 6379 |
|||
timeout: 1000 |
|||
eureka: |
|||
instance: |
|||
ip-address: 127.0.0.1 |
|||
|
|||
smsCode: 0 |
|||
file: |
|||
path: /home/ptos_tall/server//uploads/ |
|||
domain: https://test.tall.wiki/gateway/ptos_tall |
|||
imgDomain: https://test.tall.wiki/gateway/ptos_tall/uploads/ |
@ -0,0 +1,4 @@ |
|||
spring: |
|||
profiles: |
|||
active: dev |
|||
include: common, util-dev |
@ -0,0 +1,34 @@ |
|||
spring: |
|||
datasource: |
|||
druid: |
|||
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
|||
driverClassName: com.mysql.cj.jdbc.Driver |
|||
dynamicUrl: jdbc:mysql://localhost:3306/${schema} |
|||
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' |
|||
filterName: druidFilter |
|||
filterProfileEnable: true |
|||
filterUrlPattern: /* |
|||
filters: stat,wall |
|||
initialSize: 5 |
|||
maxActive: 20 |
|||
maxPoolPreparedStatementPerConnectionSize: 20 |
|||
maxWait: 60000 |
|||
minEvictableIdleTimeMillis: 300000 |
|||
minIdle: 5 |
|||
# password: 37080c1f223685592316b02dad8816c019290a476e54ebb638f9aa3ba8b6bdb9 |
|||
password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473 |
|||
poolPreparedStatements: true |
|||
servletLogSlowSql: true |
|||
servletLoginPassword: 111111 |
|||
servletLoginUsername: druid |
|||
servletName: druidServlet |
|||
servletResetEnable: true |
|||
servletUrlMapping: /druid/* |
|||
testOnBorrow: false |
|||
testOnReturn: false |
|||
testWhileIdle: true |
|||
timeBetweenEvictionRunsMillis: 60000 |
|||
url: jdbc:mysql://101.201.226.163:3306/tall_dh?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true |
|||
username: root |
|||
validationQuery: SELECT 1 FROM DUAL |
|||
env: CCSENS_TALL |
@ -0,0 +1,35 @@ |
|||
spring: |
|||
datasource: |
|||
druid: |
|||
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
|||
driverClassName: com.mysql.cj.jdbc.Driver |
|||
dynamicUrl: jdbc:mysql://localhost:3306/${schema} |
|||
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' |
|||
filterName: druidFilter |
|||
filterProfileEnable: true |
|||
filterUrlPattern: /* |
|||
filters: stat,wall |
|||
initialSize: 5 |
|||
maxActive: 20 |
|||
maxPoolPreparedStatementPerConnectionSize: 20 |
|||
maxWait: 60000 |
|||
minEvictableIdleTimeMillis: 300000 |
|||
minIdle: 5 |
|||
# password: |
|||
password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473 |
|||
poolPreparedStatements: true |
|||
servletLogSlowSql: true |
|||
servletLoginPassword: 111111 |
|||
servletLoginUsername: druid |
|||
servletName: druidServlet |
|||
servletResetEnable: true |
|||
servletUrlMapping: /druid/* |
|||
testOnBorrow: false |
|||
testOnReturn: false |
|||
testWhileIdle: true |
|||
timeBetweenEvictionRunsMillis: 60000 |
|||
# url: jdbc:mysql://127.0.0.1/defaultwbs?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true |
|||
url: jdbc:mysql://101.201.226.163:3306/tall_dm?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true |
|||
username: root |
|||
validationQuery: SELECT 1 FROM DUAL |
|||
env: CCSENS_TALL |
@ -0,0 +1,34 @@ |
|||
spring: |
|||
datasource: |
|||
druid: |
|||
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
|||
driverClassName: com.mysql.cj.jdbc.Driver |
|||
dynamicUrl: jdbc:mysql://localhost:3306/${schema} |
|||
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' |
|||
filterName: druidFilter |
|||
filterProfileEnable: true |
|||
filterUrlPattern: /* |
|||
filters: stat,wall |
|||
initialSize: 5 |
|||
maxActive: 20 |
|||
maxPoolPreparedStatementPerConnectionSize: 20 |
|||
maxWait: 60000 |
|||
minEvictableIdleTimeMillis: 300000 |
|||
minIdle: 5 |
|||
# password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473 |
|||
password: |
|||
poolPreparedStatements: true |
|||
servletLogSlowSql: true |
|||
servletLoginPassword: 111111 |
|||
servletLoginUsername: druid |
|||
servletName: druidServlet |
|||
servletResetEnable: true |
|||
servletUrlMapping: /druid/* |
|||
testOnBorrow: false |
|||
testOnReturn: false |
|||
testWhileIdle: true |
|||
timeBetweenEvictionRunsMillis: 60000 |
|||
url: jdbc:mysql://101.201.226.163:3306/tall_dm?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true |
|||
username: root |
|||
validationQuery: SELECT 1 FROM DUAL |
|||
env: CCSENS_TALL |
@ -0,0 +1,196 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 --> |
|||
<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true --> |
|||
<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 --> |
|||
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 --> |
|||
<configuration scan="true" scanPeriod="10 seconds"> |
|||
|
|||
<!--<include resource="org/springframework/boot/logging/logback/base.xml" />--> |
|||
|
|||
<contextName>logback</contextName> |
|||
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 --> |
|||
<property name="log.path" value="/home/ptos_tall/server/log/" /> |
|||
|
|||
<!-- 彩色日志 --> |
|||
<!-- 彩色日志依赖的渲染类 --> |
|||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> |
|||
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> |
|||
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> |
|||
<!-- 彩色日志格式 --> |
|||
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
|||
|
|||
|
|||
<!--输出到控制台--> |
|||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
|||
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> |
|||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
|||
<level>info</level> |
|||
</filter> |
|||
<encoder> |
|||
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
|||
<!-- 设置字符集 --> |
|||
<charset>UTF-8</charset> |
|||
</encoder> |
|||
</appender> |
|||
|
|||
|
|||
<!--输出到文件--> |
|||
|
|||
<!-- 时间滚动输出 level为 DEBUG 日志 --> |
|||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文件的路径及文件名 --> |
|||
<file>${log.path}/log_debug.log</file> |
|||
<!--日志文件输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> <!-- 设置字符集 --> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<!-- 日志归档 --> |
|||
<fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文件保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文件只记录debug级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>debug</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 时间滚动输出 level为 INFO 日志 --> |
|||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文件的路径及文件名 --> |
|||
<file>${log.path}/log_info.log</file> |
|||
<!--日志文件输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<!-- 每天日志归档路径以及格式 --> |
|||
<fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文件保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文件只记录info级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>info</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 时间滚动输出 level为 WARN 日志 --> |
|||
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文件的路径及文件名 --> |
|||
<file>${log.path}/log_warn.log</file> |
|||
<!--日志文件输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> <!-- 此处设置字符集 --> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文件保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文件只记录warn级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>warn</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
|
|||
<!-- 时间滚动输出 level为 ERROR 日志 --> |
|||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文件的路径及文件名 --> |
|||
<file>${log.path}/log_error.log</file> |
|||
<!--日志文件输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> <!-- 此处设置字符集 --> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文件保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文件只记录ERROR级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>ERROR</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- |
|||
<logger>用来设置某一个包或者具体的某一个类的日志打印级别、 |
|||
以及指定<appender>。<logger>仅有一个name属性, |
|||
一个可选的level和一个可选的addtivity属性。 |
|||
name:用来指定受此logger约束的某一个包或者具体的某一个类。 |
|||
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, |
|||
还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。 |
|||
如果未设置此属性,那么当前logger将会继承上级的级别。 |
|||
addtivity:是否向上级logger传递打印信息。默认是true。 |
|||
--> |
|||
<!--<logger name="org.springframework.web" level="info"/>--> |
|||
<!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>--> |
|||
<!-- |
|||
使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作: |
|||
第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息 |
|||
第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别: |
|||
--> |
|||
|
|||
|
|||
<!-- |
|||
root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性 |
|||
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, |
|||
不能设置为INHERITED或者同义词NULL。默认是DEBUG |
|||
可以包含零个或多个元素,标识这个appender将会添加到这个logger。 |
|||
--> |
|||
|
|||
<!--开发环境:打印控制台--> |
|||
<springProfile name="dev"> |
|||
<logger name="com.ccsens.ptpro.persist.*" level="debug"/> |
|||
</springProfile> |
|||
|
|||
<root level="info"> |
|||
<appender-ref ref="CONSOLE" /> |
|||
<appender-ref ref="DEBUG_FILE" /> |
|||
<appender-ref ref="INFO_FILE" /> |
|||
<appender-ref ref="WARN_FILE" /> |
|||
<appender-ref ref="ERROR_FILE" /> |
|||
</root> |
|||
|
|||
<!--生产环境:输出到文件--> |
|||
<!--<springProfile name="pro">--> |
|||
<!--<root level="info">--> |
|||
<!--<appender-ref ref="CONSOLE" />--> |
|||
<!--<appender-ref ref="DEBUG_FILE" />--> |
|||
<!--<appender-ref ref="INFO_FILE" />--> |
|||
<!--<appender-ref ref="ERROR_FILE" />--> |
|||
<!--<appender-ref ref="WARN_FILE" />--> |
|||
<!--</root>--> |
|||
<!--</springProfile>--> |
|||
|
|||
</configuration> |
@ -1,13 +0,0 @@ |
|||
package com.ccsens.test_controller; |
|||
|
|||
import org.springframework.boot.SpringApplication; |
|||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
|||
|
|||
@SpringBootApplication |
|||
public class TestControllerApplication { |
|||
|
|||
public static void main(String[] args) { |
|||
SpringApplication.run(TestControllerApplication.class, args); |
|||
} |
|||
|
|||
} |
@ -1,25 +0,0 @@ |
|||
package com.ccsens.test_controller.api; |
|||
|
|||
|
|||
import com.ccsens.util.JsonResponse; |
|||
import io.swagger.annotations.ApiParam; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/business") |
|||
public interface CcsensTestController { |
|||
|
|||
|
|||
|
|||
@RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|||
JsonResponse queryBusiness(@ApiParam @Validated @RequestBody String params); |
|||
|
|||
|
|||
} |
@ -1 +0,0 @@ |
|||
|
@ -1,13 +0,0 @@ |
|||
package com.ccsens.test_controller; |
|||
|
|||
import org.junit.jupiter.api.Test; |
|||
import org.springframework.boot.test.context.SpringBootTest; |
|||
|
|||
@SpringBootTest |
|||
class TestControllerApplicationTests { |
|||
|
|||
@Test |
|||
void contextLoads() { |
|||
} |
|||
|
|||
} |
Loading…
Reference in new issue