Commit 51202cdc by xxlv

Add quick script

parent 4d79f881
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
#!/usr/bin/python
#-*- coding:utf-8 -*-
import os
DIR="./template"
TMP="./tmp"
def find_ydl_project(path):
# target_path
# target_pathtarget-path-intf
# target_path/target-pathr-service
# 如果满足当前的目录结构 就认为是YDL project
pass
# cp文件
def cpfile(from,to):
pass
# 编译内容
def compile_content(dist,content,vars):
pass
# 获取编译后的名字
def get_real_name(name,vars):
pass
# gen
def gen():
for root, dirs, files in os.walk(DIR, False):
print(files)
if __name__=="__main__":
gen()
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