No Description

Jacky Wong 0560b01198 Merge remote-tracking branch 'origin/master' 4 years ago
.mvn 397a5909f1 '会员积分不分表' 5 years ago
lib 80cd7a9681 first commit 5 years ago
member-common 9192517b5d delete packaged files 5 years ago
member-services 0560b01198 Merge remote-tracking branch 'origin/master' 4 years ago
member-services-models 3b31d7a3cc 清掉无用代码、依赖、配置 5 years ago
member-web f51f53e8ec 修复商品按等级显示bug,更新前端 4 years ago
member-web-common 38698a9b12 '积分计算接口修改' 4 years ago
member-weixin-service e6ec4a7304 修复,改https为http url 4 years ago
.gitignore 4332a2865f - 5 years ago
README.md 35a44bfa82 更新readme 5 years ago
derby.log 806515e03c 完成订单统计的四个接口 5 years ago
mvnw 80cd7a9681 first commit 5 years ago
mvnw.cmd 80cd7a9681 first commit 5 years ago
pom.xml 3b31d7a3cc 清掉无用代码、依赖、配置 5 years ago
updateAndStart.sh f8d7bb26a1 try test chage take 5 5 years ago

README.md

会员系统的Java端API接口服务器


使用Spring Boot + Spring-data-jpa 构建 接口文档使用swagger-ui管理, 文档url /doc.html

mvn启动命令mvn -f ./member-web/pom.xml spring-boot:run

服务器部署、启动命令:

screen -r MemberCenter (进入名为MemberCenter的screen)
(如果没有就用 screen -S MemberCenter 创建一个)
cd /usr/local/src/MemberCenter_DW/
git pull origin master
mvn clean package install
export workerid=0
export datacenterid=0
java -Dhttps.proxyHost=192.168.50.32 -Dhttps.proxyPort=1808 -Dhttp.proxyHost=192.168.50.32 -Dhttp.proxyPort=1808 -jar member-web/target/member-web-0.0.1-SNAPSHOT.jar
ctrl + a (松开后按 d) 退出当前screen,让其后台运行

2019-11-5 更新

在使用新添加的sql查询导出excel的接口时,因为不知道为什么使用react框架的request来请求时,post不行,使用了blob也不行,就改成了get的方式,参数从sessionStorge里去取,然后编码提交,如下:

{
	title:"测试表格",
	url:{
		read:"/japi/birdgird/readSql?dsId=4028b2a26daf6c2d016db34bc5ca00a5&sqlId=40288ad66df10dc9016df1101fe40001",
		add:"/japi/birdgird/add?dsId=4028b2a26daf6c2d016db34bc5ca00a5&tableName=contract",
		edit:"/japi/birdgird/edit?dsId=4028b2a26daf6c2d016db34bc5ca00a5&tableName=contract&pkColumn=id",
		delete:"/japi/birdgird/delete?dsId=4028b2a26daf6c2d016db34bc5ca00a5&tableName=contract&pkColumn=id"
	},
	checkable:true,
	actions:[{
		name:"导出excel", onClick: function() {
			let dtoStr = sessionStorage.getItem('queryDto');
			dtoStr = encodeURI(dtoStr);
			window.location = "http://localhost:8090/sqlExport/export?dsId=4028b2a26daf6c2d016db34bc5ca00a5&sqlId=40288a9d6e357e33016e3598b42a0000&requestStr="+dtoStr;
		}
	}],
	columns:[
		{title:"主编号", data:"t.id", type:"text",hide:true},
		{title:"名称",data:"t.name", type:"text",editor: {}, query: true},
		{title:"个人电话",data:"t.personal_phone", type:"text",editor: {}, query: true},
		{title:"个人手机",data:"t.personal_cellphone", type:"text",editor: {}, query: true},
		{title:"组名称",data:"t2.name",type:"text"},
		{title:"操作",type:"command",actions:[{
			name: '行内按钮',
            onClick: (data) => {
              console.log(data);
            }
		}]}
	],
}

2019-11-15 更新

启动时需要添加proxy代理信息:

java -Dhttps.proxyHost=192.168.50.32 -Dhttps.proxyPort=1808 -Dhttp.proxyHost=192.168.50.32 -Dhttp.proxyPort=1808 -jar xxxx.jar

2019-12-06 更新

启动时需要添加机器编号和数据中心编号,为了使部分对象生成分布式ID

export workerid=0
export datacenterid=0 
java -Dhttps.proxyHost=192.168.50.32 -Dhttps.proxyPort=1808 -Dhttp.proxyHost=192.168.50.32 -Dhttp.proxyPort=1808 -jar xxxx.jar

2019-12-17 develop 更新

添加了动态请求查询参数,格式如下:

  • 基本分页: GET {url}?page=1&size=10
  • 基本分页排序: GET {url}?page=1&size=10&sortField=crtDate&sortDirection=DESC sortField 是需要排序的字段 sortDirection 是升降序
  • 基本带参数查询: GET {url}?name=yourname&age=20&... 非关键字(上面两条中的)的参数,直接视为等于的操作。
  • 不同类型的参数查询: GET {url}?age=20&ageOperate=LessEqual&... 使用 字段名+Operate 的参数来表示判断类型:
操作类型 说明
Equal 等于(默认)
NotEqual 不等于
Less (数字类型)小于
LessEqual (数字类型)不大于
Greater (数字类型)大于
GreaterEqual (数字类型)不小于
Contains (字符串)包含
StartWith (字符串)以开头
EndWith (字符串)以结尾
  • 代码中使用: 已经在拦截器中添加了GET请求解析参数的功能,解析完参数后放到ThreadLocal中,若需要取param参数值, 可以直接去com.liangjian.dataplatform.member.entity.token.DynamicParamGetter取:

Service层:

//...
@Service
public class YourService extends DynamicQueryService<YourEntity> implements  IYourService {
    @Autowired
    private YourRepository yourRepository;
    
    @Overrive
    public JpaSpecificationExecutor<YourEntity> getJpaRepository() {
        return yourRepository;
    }
    
    //父类已经包含了动态查询返回Page和返回List的方法
}

Controller层:

@Controller
public class YourController {
    //...
    
    @Autowired
    private IYourService iYourService;
    
    //例子:
    @GetMapping("/page")
    public Page<YourEntity> page() {
        var params = DynamicParamGetter.DynamicParams.get();
        return iYourService.queryPageByCondition(params);
    }
    
    @GetMapping("/page")
    public List<YourEntity> list() {
        var params = DynamicParamGetter.DynamicParams.get();
        return iYourService.queryListByCondition(params);
    }
}