|
@@ -0,0 +1,76 @@
|
|
|
|
+package com.dragoninfo.dcuc.authweb.restcontroller.sub;
|
|
|
|
+
|
|
|
|
+import com.dragoninfo.dcuc.app.facade.IResourceFacade;
|
|
|
|
+import com.dragoninfo.dcuc.auth.sub.facade.ISubSyncFacade;
|
|
|
|
+import com.dragoninfo.dcuc.authweb.util.VersionUtils;
|
|
|
|
+import com.dragoninfo.duceap.core.response.Result;
|
|
|
|
+import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 主客体资源同步Controller
|
|
|
|
+ * @author mazq
|
|
|
|
+ * @date 2021/5/27
|
|
|
|
+ */
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping(value = "/syncsvr/"+ VersionUtils.VERSION_UID)
|
|
|
|
+public class SubSyncController {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ISubSyncFacade subSyncFacade;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IResourceFacade resourceFacade;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "授权主体-人员信息同步")
|
|
|
|
+ @GetMapping(value = "userSync")
|
|
|
|
+ public Result userSync() {
|
|
|
|
+ ResponseStatus response = subSyncFacade.userSync();
|
|
|
|
+ if (ResponseStatus.SUCCESS_CODE.equals(response.getStatusCode())) {
|
|
|
|
+ return Result.success();
|
|
|
|
+ } else {
|
|
|
|
+ return Result.fail(response.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "授权主体-机构信息同步")
|
|
|
|
+ @GetMapping(value = "orgSync")
|
|
|
|
+ public Result orgSync() {
|
|
|
|
+ ResponseStatus response = subSyncFacade.orgSync();
|
|
|
|
+ if (ResponseStatus.SUCCESS_CODE.equals(response.getStatusCode())) {
|
|
|
|
+ return Result.success();
|
|
|
|
+ } else {
|
|
|
|
+ return Result.fail(response.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "授权主体-服务信息同步")
|
|
|
|
+ @GetMapping(value = "serSync")
|
|
|
|
+ public Result serSync() {
|
|
|
|
+ ResponseStatus response = resourceFacade.subSerSync();
|
|
|
|
+ if (ResponseStatus.SUCCESS_CODE.equals(response.getStatusCode())) {
|
|
|
|
+ return Result.success();
|
|
|
|
+ } else {
|
|
|
|
+ return Result.fail(response.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "授权主体-应用信息同步")
|
|
|
|
+ @GetMapping(value = "appSync")
|
|
|
|
+ public Result appSync() {
|
|
|
|
+ ResponseStatus response = resourceFacade.subAppSync();
|
|
|
|
+ if (ResponseStatus.SUCCESS_CODE.equals(response.getStatusCode())) {
|
|
|
|
+ return Result.success();
|
|
|
|
+ } else {
|
|
|
|
+ return Result.fail(response.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|