Commit 4d79f881 by xxlv

Init

parents
package com.ydl.user.intf.po;
public class ${PLACE} {
}
\ No newline at end of file
package com.ydl.user.service.biz;
import com.ydl.common.service.IService;
import com.ydl.user.intf.po.${PLACE};
public interface BlackListBiz extends IService<${PLACE}> {
}
package com.ydl.user.service.biz.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ydl.common.utils.Util;
import com.ydl.user.intf.po.${PLACE};
import com.ydl.user.service.biz.${PLACE}Biz;
import com.ydl.user.service.dao.${PLACE}Mapper;
import org.springframework.stereotype.Service;
import com.ydl.common.service.impl.BaseService;
import javax.annotation.Resource;
@Service
public class ${PLACE}BizImpl extends BaseService<${PLACE}> implements ${PLACE}Biz {
@Resource
private ${PLACE}Mapper ${PLACE_VAR}Mapper;
}
package com.ydl.user.intf.facade;
import com.github.pagehelper.PageInfo;
import com.ydl.common.dto.BaseDtoResponse;
import com.ydl.user.intf.dto.response.BooleanRespDto;
import com.ydl.user.intf.dto.response.ChatBlackRespDto;
import io.swagger.annotations.ApiOperation;
public interface ${PLACE}Facade {
}
package com.ydl.user.service.facade;
import com.ydl.common.dto.BaseDtoResponse;
import com.ydl.common.helper.ResponseFormatterHelper;
import com.ydl.common.utils.ModelMapperUtil;
import com.ydl.user.intf.facade.${PLACE}Facade;
import com.ydl.user.service.biz.${PLACE}Biz;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class ${PLACE}FacadeImpl implements ${PLACE}Facade {
@Resource
private ${PLACE} ${PLACE_VAR}Biz;
}
package com.ydl.user.service.dao;
import com.ydl.common.service.BaseMapper;
import com.ydl.user.intf.po.${PLACE};
public interface ${PLACE}Mapper extends BaseMapper<${PLACE}> {
}
<?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.ydl.user.service.dao.${PLACE}Mapper" >
</mapper>
\ No newline at end of file
package com.ydl.user.intf.dto.request;
import java.io.Serializable;
public class ${PLACE}ReqDto implements Serializable {
//...
}
package com.ydl.user.intf.dto.response;
public class ${PLACE}RespDto {
}
package com.ydl.user.service.biz.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ydl.common.utils.Util;
import com.ydl.user.intf.po.ChatBlack;
import com.ydl.user.intf.po.Doctor;
import com.ydl.user.service.biz.BlackListBiz;
import com.ydl.user.service.dao.ChatBlackMapper;
import org.springframework.stereotype.Service;
import com.ydl.common.service.impl.BaseService;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service
public class ${PLACE}BizImpl extends BaseService<${PLACE}> implements ${PLACE}Biz {
@Resource
private ${PLACE}Mapper ${PLACE_VAR}Mapper;
@Override
public PageInfo getMyBlackListForChatByUidPaging(Long uid, int pageNum, int pageSize) {
PageHelper.startPage(pageNum, pageSize);
Example example = new Example(ChatBlack.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("uid", uid);
List list = this.getByExample(example);
return new PageInfo(list);
}
@Override
public ChatBlack addUserToBlackList(Long uid, Long blackUid, Integer type) {
ChatBlack chatBlack = new ChatBlack();
chatBlack.setUid(uid.intValue());
chatBlack.setUidBlack(blackUid.intValue());
ChatBlack findChatBlack = null;
try {
findChatBlack = chatBlackMapper.selectOne(chatBlack);
} catch (Exception e) {
e.printStackTrace();
}
if (!Util.isEmpty(findChatBlack)) {
return findChatBlack;
}
// new chat black
chatBlack.setCreateTime(new Date());
chatBlack.setStatus((byte) 1);
chatBlack.setType(type.byteValue());
return this.save(chatBlack);
}
@Override
public Boolean removeUserFromBlackList(Long uid, Long blackUid) {
ChatBlack chatBlack = new ChatBlack();
chatBlack.setUid(uid.intValue());
chatBlack.setUidBlack(blackUid.intValue());
ChatBlack findChatBlack;
try {
findChatBlack = chatBlackMapper.selectOne(chatBlack);
} catch (Exception e) {
e.printStackTrace();
return false;
}
if (Util.isEmpty(findChatBlack)) {
return false;
}
if (findChatBlack.getType().equals((byte) 1)) {
ChatBlack updatedChatBlack = new ChatBlack();
updatedChatBlack.setId(findChatBlack.getId());
updatedChatBlack.setType((byte) 2);
int refNu = chatBlackMapper.updateByPrimaryKeySelective(updatedChatBlack);
return refNu > 0;
}
return false;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/quick_tpl.iml" filepath="$PROJECT_DIR$/.idea/quick_tpl.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.idea" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ 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