Merge branch 'dev' into 'master'
Dev See merge request eshop/biz_service_ebtp_extend!4
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
FROM harbor.dcos.guangzhou.unicom.local/eshop/skywalking_agent_springboot_8.1.0:v1.0
|
||||
FROM harbor.dcos.guangzhou.unicom.local/eshop/jdk8_springboot_agent:v1.6
|
||||
ENV LC_ALL=zh_CN.utf8
|
||||
ENV LANG=zh_CN.utf8
|
||||
ENV LANGUAGE=zh_CN.utf8
|
||||
@ -7,4 +7,4 @@ RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
|
||||
RUN mkdir -p /model
|
||||
COPY /target/classes/model/. /model/
|
||||
ADD /target/biz_service_ebtp_extend-0.0.1.jar /biz_service_ebtp_extend-0.0.1.jar
|
||||
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=test", "-jar", "/biz_service_ebtp_extend-0.0.1.jar"]
|
||||
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-javaagent:/skywalking/agent/skywalking-agent.jar", "-Dspring.profiles.active=test", "-jar", "/biz_service_ebtp_extend-0.0.1.jar"]
|
||||
|
@ -46,7 +46,11 @@ spec:
|
||||
env:
|
||||
# Apollo 配置中心变量设置
|
||||
- name: APOLLO_CONFIGSERVICE
|
||||
value: http://10.242.37.1488:6001
|
||||
value: http://10.242.37.1488:6001
|
||||
- name: SW_AGENT_COLLECTOR_BACKEND_SERVICES
|
||||
value: skywalking-oap-cluster.skywalking:11800
|
||||
- name: SW_AGENT_NAME
|
||||
value: biz-service-ebtp-extend
|
||||
---
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
|
@ -1,8 +1,13 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.bizmessage.dao;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessage;
|
||||
|
||||
public interface BizMessageMapper extends BaseMapper<BizMessage> {
|
||||
|
||||
IPage<BizMessage> findMessage(@Param("param") IPage<BizMessage> page, @Param("userId") String userId);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,21 @@
|
||||
<?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.chinaunicom.mall.ebtp.extend.bizmessage.dao.BizMessageMapper">
|
||||
|
||||
<select id="findMessage" resultType="com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessage">
|
||||
SELECT *
|
||||
FROM biz_message
|
||||
WHERE authorize = 0
|
||||
|
||||
<if test="userId!=null and userId!=''">
|
||||
UNION ALL
|
||||
|
||||
SELECT a.*
|
||||
FROM ( SELECT * FROM biz_message WHERE authorize = 1) a
|
||||
INNER JOIN
|
||||
( SELECT * FROM biz_message_authorize WHERE user_id = #{userId}) b ON a.id = b.message_id
|
||||
</if>
|
||||
ORDER BY createtime DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -7,9 +7,9 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.chinaunicom.mall.ebtp.common.base.service.IBaseCacheUserService;
|
||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.dao.BizMessageMapper;
|
||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.dto.PageDTO;
|
||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessage;
|
||||
@ -27,6 +27,7 @@ import com.chinaunicom.mall.ebtp.extend.bizmessage.vo.DescribeSiteMsgVO;
|
||||
public class BizMessageConsumerServiceImpl implements BizMessageConsumerService {
|
||||
|
||||
private @Autowired BizMessageMapper mapper;
|
||||
private @Autowired IBaseCacheUserService service;
|
||||
|
||||
/**
|
||||
* 消息概要列表
|
||||
@ -36,11 +37,10 @@ public class BizMessageConsumerServiceImpl implements BizMessageConsumerService
|
||||
@Override
|
||||
public IBizMessagePage<DescribeSiteMsgVO> listOutline(PageDTO page) {
|
||||
page = createPageCondition(page);
|
||||
|
||||
IPage<BizMessage> pageEntity = mapper.selectPage(new Page<>(page.getPageNo(), page.getPageSize()),
|
||||
new QueryWrapper<BizMessage>().select("id", "title", "category", "createtime")
|
||||
.orderByDesc("createtime"));
|
||||
|
||||
|
||||
IPage<BizMessage> pageEntity = mapper.findMessage(new Page<BizMessage>(page.getPageNo(), page.getPageSize()),
|
||||
service.getCacheUser().getUserId());
|
||||
|
||||
// DAT -> VO 转换
|
||||
IBizMessagePage<DescribeSiteMsgVO> result = new BizMessagePage<>();
|
||||
BeanUtils.copyProperties(pageEntity, result, "records");
|
||||
|
Reference in New Issue
Block a user