Commit bf394c75 authored by zhangc's avatar zhangc

添加商城+后台日志相关接口

parent d22a126f
...@@ -11,10 +11,7 @@ import io.swagger.annotations.Api; ...@@ -11,10 +11,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
/** /**
...@@ -36,13 +33,24 @@ public class LogInfoController { ...@@ -36,13 +33,24 @@ public class LogInfoController {
private LogInfoService logInfoService; private LogInfoService logInfoService;
/** /**
* @Description: 添加企业认证信息 * @Description: 获取商城用户日志信息列表
* @Author: Mr.zhang * @Author: Mr.zhang
* @Date: 2020-12-2 * @Date: 2020-12-2
*/ */
@PostMapping("/getMallLogInfo") @PostMapping("/getMallLogInfo")
@ApiOperation(value = "获取商城用户日志信息") @ApiOperation(value = "获取商城用户日志信息列表")
public Mono<Result<PageInfoResponse<PlatformLog>>> getLogInfo(@RequestBody @Validated LogInfoQueryReq req) { public Mono<Result<PageInfoResponse<PlatformLog>>> getLogInfo(@RequestBody @Validated LogInfoQueryReq req) {
return Mono.fromSupplier(() -> logInfoService.getMallUserLogInfo(req)); return Mono.fromSupplier(() -> logInfoService.getMallUserLogInfo(req));
} }
/**
* @Description: 获取商城用户日志信息详情
* @Author: Mr.zhang
* @Date: 2020-12-2
*/
@PostMapping("/getMallLogDetail")
@ApiOperation(value = "获取商城用户日志信息详情")
public Mono<Result> getLogInfoDetail(@RequestParam(value = "日志信息Id") Long platformLogId) {
return Mono.fromSupplier(() -> logInfoService.getMallUserLogDetail(platformLogId));
}
} }
...@@ -23,4 +23,11 @@ public interface LogInfoService { ...@@ -23,4 +23,11 @@ public interface LogInfoService {
* @return * @return
*/ */
Result<PageInfoResponse<PlatformLog>> getMallUserLogInfo(LogInfoQueryReq req); Result<PageInfoResponse<PlatformLog>> getMallUserLogInfo(LogInfoQueryReq req);
/**
* 获取商城用户日志信息详情
* @param platformLogId
* @return
*/
Result getMallUserLogDetail(Long platformLogId);
} }
...@@ -59,4 +59,18 @@ public class LogInfoServiceImpl implements LogInfoService { ...@@ -59,4 +59,18 @@ public class LogInfoServiceImpl implements LogInfoService {
pageInfoResponse.setData(pageInfo); pageInfoResponse.setData(pageInfo);
return Result.of_success(pageInfoResponse); return Result.of_success(pageInfoResponse);
} }
/**
* 获取商城用户日志信息详情
* @param platformLogId
* @return
*/
@Override
public Result getMallUserLogDetail(Long platformLogId) {
PlatformLog platformLog = platformLogDao.selectById(platformLogId);
if (null == platformLog){
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
return Result.of_success(platformLog);
}
} }
...@@ -3,5 +3,7 @@ ...@@ -3,5 +3,7 @@
<mapper namespace="com.jz.dm.mall.moduls.mapper.PlatformLogDao"> <mapper namespace="com.jz.dm.mall.moduls.mapper.PlatformLogDao">
<select id="listMallLogInfo" resultType="com.jz.common.entity.PlatformLog">
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -141,6 +141,10 @@ ...@@ -141,6 +141,10 @@
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
</dependency>
<!--阿里云服务器短信平台--> <!--阿里云服务器短信平台-->
<dependency> <dependency>
<groupId>com.aliyun</groupId> <groupId>com.aliyun</groupId>
......
package com.jz.manage.moduls.controller.log; package com.jz.manage.moduls.controller.log;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.entity.PlatformLog;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController; import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.log.bean.ManageLogInfoQueryReq;
import com.jz.manage.moduls.service.PlatformLogService; import com.jz.manage.moduls.service.PlatformLogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Mono;
/** /**
* 日志管理(TPlatformLog)表控制层 * 日志管理(TPlatformLog)表控制层
...@@ -21,5 +27,25 @@ public class PlatformLogController extends BaseController { ...@@ -21,5 +27,25 @@ public class PlatformLogController extends BaseController {
@Autowired @Autowired
private PlatformLogService tPlatformLogService; private PlatformLogService tPlatformLogService;
/**
* @Description: 后台用户日志信息列表
* @Author: Mr.zhang
* @Date: 2020-12-2
*/
@PostMapping("/listManageLogInfo")
@ApiOperation(value = "后台用户日志信息列表")
public Mono<Result<PageInfoResponse<PlatformLog>>> getLogInfo(@RequestBody @Validated ManageLogInfoQueryReq req) {
return Mono.fromSupplier(() -> tPlatformLogService.listManageUserLogInfo(req));
}
/**
* @Description: 获取用户日志信息详情
* @Author: Mr.zhang
* @Date: 2020-12-2
*/
@PostMapping("/getLogDetail")
@ApiOperation(value = "获取用户日志信息详情")
public Mono<Result> getLogInfoDetail(@RequestParam(value = "日志信息Id") Long platformLogId) {
return Mono.fromSupplier(() -> tPlatformLogService.getMallUserLogDetail(platformLogId));
}
} }
\ No newline at end of file
...@@ -3,6 +3,8 @@ package com.jz.manage.moduls.mapper; ...@@ -3,6 +3,8 @@ package com.jz.manage.moduls.mapper;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.common.entity.PlatformLog; import com.jz.common.entity.PlatformLog;
import java.util.List;
/** /**
* 日志管理(TPlatformLog)表数据库访问层 * 日志管理(TPlatformLog)表数据库访问层
* *
...@@ -11,4 +13,11 @@ import com.jz.common.entity.PlatformLog; ...@@ -11,4 +13,11 @@ import com.jz.common.entity.PlatformLog;
*/ */
public interface PlatformLogDao extends BaseMapper<PlatformLog> { public interface PlatformLogDao extends BaseMapper<PlatformLog> {
/**
* 查询平台用户日志列表
* @return
*/
List<PlatformLog> listMallLogInfo();
} }
\ No newline at end of file
package com.jz.manage.moduls.service; package com.jz.manage.moduls.service;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.entity.PlatformLog;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.log.bean.ManageLogInfoQueryReq;
/** /**
* 日志管理(TPlatformLog)表服务接口 * 日志管理(TPlatformLog)表服务接口
* *
...@@ -9,4 +14,17 @@ package com.jz.manage.moduls.service; ...@@ -9,4 +14,17 @@ package com.jz.manage.moduls.service;
public interface PlatformLogService { public interface PlatformLogService {
/**
* 平台用户日志列表
* @param req
* @return
*/
Result<PageInfoResponse<PlatformLog>> listManageUserLogInfo(ManageLogInfoQueryReq req);
/**
* 获取用户日志详情
* @param platformLogId
* @return
*/
Result getMallUserLogDetail(Long platformLogId);
} }
\ No newline at end of file
package com.jz.manage.moduls.service.impl; package com.jz.manage.moduls.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.constant.ResultMsg;
import com.jz.common.entity.PlatformLog;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.log.bean.ManageLogInfoQueryReq;
import com.jz.manage.moduls.mapper.PlatformLogDao; import com.jz.manage.moduls.mapper.PlatformLogDao;
import com.jz.manage.moduls.service.PlatformLogService; import com.jz.manage.moduls.service.PlatformLogService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* 日志管理(TPlatformLog)表服务实现类 * 日志管理(TPlatformLog)表服务实现类
* *
...@@ -15,4 +25,31 @@ import org.springframework.stereotype.Service; ...@@ -15,4 +25,31 @@ import org.springframework.stereotype.Service;
public class PlatformLogServiceImpl implements PlatformLogService { public class PlatformLogServiceImpl implements PlatformLogService {
@Autowired @Autowired
private PlatformLogDao tPlatformLogDao; private PlatformLogDao tPlatformLogDao;
@Override
public Result<PageInfoResponse<PlatformLog>> listManageUserLogInfo(ManageLogInfoQueryReq req) {
PageInfoResponse<PlatformLog> pageInfoResponse = new PageInfoResponse<>();
PageHelper.startPage(req.getPageNum(), req.getPageSize());
List<PlatformLog> list = tPlatformLogDao.listMallLogInfo();
PageInfo<PlatformLog> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage(ResultMsg.SUCCESS.getMsg());
pageInfoResponse.setData(pageInfo);
return Result.of_success(pageInfoResponse);
}
/**
* 获取用户日志详情
* @param platformLogId
* @return
*/
@Override
public Result getMallUserLogDetail(Long platformLogId) {
PlatformLog platformLog = tPlatformLogDao.selectById(platformLogId);
if (null == platformLog){
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
return Result.of_success(platformLog);
}
} }
\ No newline at end of file
...@@ -25,189 +25,8 @@ ...@@ -25,189 +25,8 @@
<result property="creTime" column="cre_time" jdbcType="TIMESTAMP"/> <result property="creTime" column="cre_time" jdbcType="TIMESTAMP"/>
<result property="delFlag" column="del_flag" jdbcType="VARCHAR"/> <result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<select id="listMallLogInfo" resultMap="TPlatformLogMap">
<!--查询单个--> SELECT * FROM t_t_platform_log
<select id="queryById" resultMap="TPlatformLogMap">
select
platform_log_id, request_ip, caller_id, data_goods_id, api_key, request_params, return_params, request_url, request_time, service_type, data_goods_type, download_address, data_price, price_type, total_times, used_times, remain_times, start_time, end_time, cre_time, del_flag
from t_platform_log
where platform_log_id = #{platformLogId}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="TPlatformLogMap">
select
platform_log_id, request_ip, caller_id, data_goods_id, api_key, request_params, return_params, request_url, request_time, service_type, data_goods_type, download_address, data_price, price_type, total_times, used_times, remain_times, start_time, end_time, cre_time, del_flag
from t_platform_log
limit #{offset}, #{limit}
</select>
<!--通过实体作为筛选条件查询-->
<select id="queryAll" resultMap="TPlatformLogMap">
select
platform_log_id, request_ip, caller_id, data_goods_id, api_key, request_params, return_params, request_url,
request_time, service_type, data_goods_type, download_address, data_price, price_type, total_times, used_times,
remain_times, start_time, end_time, cre_time, del_flag
from t_platform_log
<where>
<if test="platformLogId != null">
and platform_log_id = #{platformLogId}
</if>
<if test="requestIp != null and requestIp != ''">
and request_ip = #{requestIp}
</if>
<if test="callerId != null and callerId != ''">
and caller_id = #{callerId}
</if>
<if test="dataGoodsId != null">
and data_goods_id = #{dataGoodsId}
</if>
<if test="apiKey != null and apiKey != ''">
and api_key = #{apiKey}
</if>
<if test="requestParams != null and requestParams != ''">
and request_params = #{requestParams}
</if>
<if test="returnParams != null and returnParams != ''">
and return_params = #{returnParams}
</if>
<if test="requestUrl != null and requestUrl != ''">
and request_url = #{requestUrl}
</if>
<if test="requestTime != null">
and request_time = #{requestTime}
</if>
<if test="serviceType != null and serviceType != ''">
and service_type = #{serviceType}
</if>
<if test="dataGoodsType != null and dataGoodsType != ''">
and data_goods_type = #{dataGoodsType}
</if>
<if test="downloadAddress != null and downloadAddress != ''">
and download_address = #{downloadAddress}
</if>
<if test="dataPrice != null">
and data_price = #{dataPrice}
</if>
<if test="priceType != null and priceType != ''">
and price_type = #{priceType}
</if>
<if test="totalTimes != null">
and total_times = #{totalTimes}
</if>
<if test="usedTimes != null">
and used_times = #{usedTimes}
</if>
<if test="remainTimes != null">
and remain_times = #{remainTimes}
</if>
<if test="startTime != null">
and start_time = #{startTime}
</if>
<if test="endTime != null">
and end_time = #{endTime}
</if>
<if test="creTime != null">
and cre_time = #{creTime}
</if>
<if test="delFlag != null and delFlag != ''">
and del_flag = #{delFlag}
</if>
</where>
</select> </select>
<!--新增所有列-->
<insert id="insert" keyProperty="platformLogId" useGeneratedKeys="true">
insert into t_platform_log(request_ip, caller_id, data_goods_id, api_key, request_params, return_params, request_url, request_time, service_type, data_goods_type, download_address, data_price, price_type, total_times, used_times, remain_times, start_time, end_time, cre_time, del_flag)
values (#{requestIp}, #{callerId}, #{dataGoodsId}, #{apiKey}, #{requestParams}, #{returnParams}, #{requestUrl}, #{requestTime}, #{serviceType}, #{dataGoodsType}, #{downloadAddress}, #{dataPrice}, #{priceType}, #{totalTimes}, #{usedTimes}, #{remainTimes}, #{startTime}, #{endTime}, #{creTime}, #{delFlag})
</insert>
<insert id="insertBatch" keyProperty="platformLogId" useGeneratedKeys="true">
insert into t_platform_log(request_ip, caller_id, data_goods_id, api_key, request_params,
return_params, request_url, request_time, service_type, data_goods_type, download_address, data_price,
price_type, total_times, used_times, remain_times, start_time, end_time, cre_time, del_flag)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.requestIp}, #{entity.callerId}, #{entity.dataGoodsId}, #{entity.apiKey}, #{entity.requestParams},
#{entity.returnParams}, #{entity.requestUrl}, #{entity.requestTime}, #{entity.serviceType},
#{entity.dataGoodsType}, #{entity.downloadAddress}, #{entity.dataPrice}, #{entity.priceType},
#{entity.totalTimes}, #{entity.usedTimes}, #{entity.remainTimes}, #{entity.startTime}, #{entity.endTime},
#{entity.creTime}, #{entity.delFlag})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update t_platform_log
<set>
<if test="requestIp != null and requestIp != ''">
request_ip = #{requestIp},
</if>
<if test="callerId != null and callerId != ''">
caller_id = #{callerId},
</if>
<if test="dataGoodsId != null">
data_goods_id = #{dataGoodsId},
</if>
<if test="apiKey != null and apiKey != ''">
api_key = #{apiKey},
</if>
<if test="requestParams != null and requestParams != ''">
request_params = #{requestParams},
</if>
<if test="returnParams != null and returnParams != ''">
return_params = #{returnParams},
</if>
<if test="requestUrl != null and requestUrl != ''">
request_url = #{requestUrl},
</if>
<if test="requestTime != null">
request_time = #{requestTime},
</if>
<if test="serviceType != null and serviceType != ''">
service_type = #{serviceType},
</if>
<if test="dataGoodsType != null and dataGoodsType != ''">
data_goods_type = #{dataGoodsType},
</if>
<if test="downloadAddress != null and downloadAddress != ''">
download_address = #{downloadAddress},
</if>
<if test="dataPrice != null">
data_price = #{dataPrice},
</if>
<if test="priceType != null and priceType != ''">
price_type = #{priceType},
</if>
<if test="totalTimes != null">
total_times = #{totalTimes},
</if>
<if test="usedTimes != null">
used_times = #{usedTimes},
</if>
<if test="remainTimes != null">
remain_times = #{remainTimes},
</if>
<if test="startTime != null">
start_time = #{startTime},
</if>
<if test="endTime != null">
end_time = #{endTime},
</if>
<if test="creTime != null">
cre_time = #{creTime},
</if>
<if test="delFlag != null and delFlag != ''">
del_flag = #{delFlag},
</if>
</set>
where platform_log_id = #{platformLogId}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from t_platform_log where platform_log_id = #{platformLogId}
</delete>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment