add getReferrerList

master
luoyang 6 years ago
parent 4b2416c8ef
commit cff2f0d16d

@ -2,8 +2,12 @@ package au.com.royalpay.payment.manage.appclient.core;
import com.alibaba.fastjson.JSONObject;
import java.util.List;
public interface ManageAppService {
void updateDevToken(JSONObject device, String devToken);
List<JSONObject> getReferrerList(JSONObject device);
}

@ -1,21 +1,33 @@
package au.com.royalpay.payment.manage.appclient.core.impls;
import au.com.royalpay.payment.manage.appclient.core.ManageAppService;
import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
import au.com.royalpay.payment.tools.device.DeviceSupport;
import au.com.royalpay.payment.tools.device.ManageDeviceSupport;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class ManageAppServiceImp implements ManageAppService {
@Resource
private ManageDeviceSupport manageDeviceSupport;
@Resource
private OrgMapper orgMapper;
@Override
public void updateDevToken(JSONObject device, String devToken) {
manageDeviceSupport.updateDeviceMessageToken(device, devToken);
}
@Override
public List<JSONObject> getReferrerList(JSONObject device) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
return orgMapper.listOrgs(1,new PageBounds());
}
}

@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/api/v1.0/manage/app")
@ -18,9 +19,13 @@ public class ManageAppController {
@Resource
private ManageAppService manageAppService;
@RequestMapping(value = "/token", method = RequestMethod.PUT)
@RequestMapping(value = "/token", method = RequestMethod.PUT)
public void updateDevToken(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestBody JSONObject token) {
manageAppService.updateDevToken(device, token.getString("devToken"));
}
@RequestMapping(value = "/referrer", method = RequestMethod.GET)
public List<JSONObject> getReferrerList(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestBody JSONObject token) {
return manageAppService.getReferrerList(device);
}
}

Loading…
Cancel
Save