5 changed files with 126 additions and 0 deletions
@ -0,0 +1,43 @@ |
|||
|
|||
package com.yxt.wms.apiadmin.aggregation; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.wms.biz.func.organizationappkey.OrganizationAppKeyService; |
|||
import com.yxt.wms.feign.portal.organizationappkey.OrganizationAppKeyDto; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2025/1/21 10:42 |
|||
*/ |
|||
@Api(tags = "申请组织appkey") |
|||
@RestController |
|||
@RequestMapping("apiadmin/organizationappkey") |
|||
public class OrganizationAppKeyRest { |
|||
|
|||
@Autowired |
|||
OrganizationAppKeyService organizationAppKeyService; |
|||
|
|||
|
|||
/** |
|||
* 申请appkey |
|||
* |
|||
* @return 申请appkey |
|||
*/ |
|||
@ApiOperation("申请appkey") |
|||
@ResponseBody |
|||
@PostMapping("/saveAppKey") |
|||
public ResultBean saveAppKey(@RequestBody OrganizationAppKeyDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return organizationAppKeyService.saveAppKey(dto); |
|||
} |
|||
@ApiOperation("根据组织查询appeky") |
|||
@ResponseBody |
|||
@GetMapping("/initialization/{orgSid}") |
|||
public ResultBean initialization(@PathVariable("orgSid") String orgSid) { |
|||
return organizationAppKeyService.getAppkeyByOrgSid(orgSid); |
|||
} |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.yxt.wms.biz.func.organizationappkey; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.wms.feign.portal.organizationappkey.OrganizationAppKeyDto; |
|||
import com.yxt.wms.feign.portal.organizationappkey.OrganizationAppKeyFeign; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2025/1/21 11:19 |
|||
*/ |
|||
@Service |
|||
public class OrganizationAppKeyService { |
|||
@Autowired |
|||
OrganizationAppKeyFeign organizationAppKeyFeign; |
|||
public ResultBean saveAppKey(OrganizationAppKeyDto dto){ |
|||
return organizationAppKeyFeign.saveAppKey(dto); |
|||
} |
|||
public ResultBean getAppkeyByOrgSid(String orgSid){ |
|||
return organizationAppKeyFeign.initialization(orgSid); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.yxt.wms.feign.portal.organizationappkey; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2025/1/21 11:19 |
|||
*/ |
|||
@Data |
|||
public class OrganizationAppKeyDto { |
|||
private String orgSid; |
|||
private String appKey; |
|||
private String secret; |
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.yxt.wms.feign.portal.organizationappkey; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
|
|||
@Api(tags = "组织appkey申请") |
|||
@FeignClient( |
|||
contextId = "ss-common-portal-OrganizationAppKey", |
|||
name = "ss-common-portal", |
|||
path = "/apiadmin/organizationappkey") |
|||
public interface OrganizationAppKeyFeign { |
|||
/** |
|||
* 申请appkey |
|||
* |
|||
* @return 申请appkey |
|||
*/ |
|||
@ApiOperation("申请appkey") |
|||
@ResponseBody |
|||
@PostMapping("/saveAppKey") |
|||
public ResultBean saveAppKey(@RequestBody OrganizationAppKeyDto dto); |
|||
@ApiOperation("根据组织查询appeky") |
|||
@ResponseBody |
|||
@GetMapping("/initialization/{orgSid}") |
|||
public ResultBean initialization(@PathVariable("orgSid") String orgSid); |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.yxt.wms.feign.portal.organizationappkey; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2025/1/21 11:19 |
|||
*/ |
|||
@Data |
|||
public class OrganizationAppKeyVo { |
|||
private String orgSid; |
|||
private String appKey; |
|||
private String secret; |
|||
} |
Loading…
Reference in new issue