parent
99893846b1
commit
4b2416c8ef
@ -0,0 +1,9 @@
|
|||||||
|
package au.com.royalpay.payment.manage.appclient.core;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
public interface ManageAppService {
|
||||||
|
|
||||||
|
void updateDevToken(JSONObject device, String devToken);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package au.com.royalpay.payment.manage.appclient.core.impls;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.appclient.core.ManageAppService;
|
||||||
|
import au.com.royalpay.payment.tools.device.DeviceSupport;
|
||||||
|
import au.com.royalpay.payment.tools.device.ManageDeviceSupport;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ManageAppServiceImp implements ManageAppService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ManageDeviceSupport manageDeviceSupport;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateDevToken(JSONObject device, String devToken) {
|
||||||
|
manageDeviceSupport.updateDeviceMessageToken(device, devToken);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package au.com.royalpay.payment.manage.appclient.web;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.appclient.core.ManageAppService;
|
||||||
|
import au.com.royalpay.payment.tools.CommonConsts;
|
||||||
|
import au.com.royalpay.payment.tools.device.ManageDeviceSupport;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/v1.0/manage/app")
|
||||||
|
public class ManageAppController {
|
||||||
|
Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ManageAppService manageAppService;
|
||||||
|
|
||||||
|
@RequestMapping(value = "/token", method = RequestMethod.PUT)
|
||||||
|
public void updateDevToken(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestBody JSONObject token) {
|
||||||
|
manageAppService.updateDevToken(device, token.getString("devToken"));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue