新增获取member资产 持仓数据查询、修改 市价开仓交易接口
parent
e9304484d9
commit
422c010523
@ -0,0 +1,26 @@
|
||||
package com.sztzjy.forex.trading_trading.controller;
|
||||
|
||||
import com.sztzjy.forex.trading_trading.annotation.AnonymousAccess;
|
||||
import com.sztzjy.forex.trading_trading.entity.Member;
|
||||
import com.sztzjy.forex.trading_trading.service.MemberService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("api/member")
|
||||
public class MemberController {
|
||||
|
||||
@Autowired
|
||||
MemberService memberService;
|
||||
|
||||
@AnonymousAccess
|
||||
@PostMapping("getMember")
|
||||
public Member getMember(@RequestBody String memberId){
|
||||
Member member = memberService.selectByPrimaryKey(memberId);
|
||||
return member;
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.sztzjy.forex.trading_trading.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.sztzjy.forex.trading_trading.annotation.AnonymousAccess;
|
||||
import com.sztzjy.forex.trading_trading.entity.TakeStash;
|
||||
import com.sztzjy.forex.trading_trading.entity.TakeStashExample;
|
||||
import com.sztzjy.forex.trading_trading.service.TakeStashService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("api/takeStash")
|
||||
public class TakeStashController {
|
||||
|
||||
@Autowired
|
||||
TakeStashService takeStashService;
|
||||
|
||||
//获取当前持仓表 status 0为获取当前持仓/1为挂单持仓/2为历史持仓
|
||||
@AnonymousAccess
|
||||
@PostMapping("getTakeStashList")
|
||||
public List<TakeStash> getTakeStashList(@RequestBody JSONObject jsonObject) {
|
||||
String trainingId = String.valueOf(jsonObject.get("trainingId"));
|
||||
String memberId = String.valueOf(jsonObject.get("memberId"));
|
||||
Integer status = (Integer) jsonObject.get("status");
|
||||
TakeStash takeStash = new TakeStash();
|
||||
takeStash.setTrainingId(trainingId);
|
||||
takeStash.setMemberId(memberId);
|
||||
takeStash.setStatus(status);
|
||||
List<TakeStash> takeStashList = takeStashService.findTakeStashByTrainingIdAndMemberIdAndStatus(trainingId, memberId, status);
|
||||
return takeStashList;
|
||||
}
|
||||
|
||||
//根据持仓ID获取单个持仓数据
|
||||
@AnonymousAccess
|
||||
@PostMapping("getTakeStash")
|
||||
public TakeStash getTakeStash(@RequestBody JSONObject jsonObject) {
|
||||
String trainingId = String.valueOf(jsonObject.get("trainingId"));
|
||||
TakeStash takeStash = takeStashService.selectByPrimaryKey(trainingId);
|
||||
return takeStash;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue