Browse Source

获取公钥

huangzhiyong 6 years ago
parent
commit
d0e49a70f8

+ 0 - 12
src/main/java/com/yihu/ehr/organization/controller/OrganizationController.java

@ -840,16 +840,4 @@ public class OrganizationController extends BaseController {
        return listMap;
    }
    @RequestMapping(value = "/{org_code}/key", method = RequestMethod.GET)
    @ApiOperation(value = "获取机构公钥", notes = "机构公钥")
    public KeyModel getPublicKey(
            @ApiParam(name = "org_code", value = "机构代码")
            @PathVariable(value = "org_code")
                    String orgCode) {
        MKey key = securityClient.getOrgKey(orgCode);
        KeyModel model = new KeyModel();
        BeanUtils.copyProperties(key, model, "privateKey","fromDate","expiryDate");
        return model;
    }
}

+ 71 - 0
src/main/java/com/yihu/ehr/organization/controller/OrganizationOpenController.java

@ -0,0 +1,71 @@
package com.yihu.ehr.organization.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.adapter.service.AdapterOrgClient;
import com.yihu.ehr.adapter.service.PlanClient;
import com.yihu.ehr.agModel.geogrephy.GeographyModel;
import com.yihu.ehr.agModel.org.OrgDetailModel;
import com.yihu.ehr.agModel.org.OrgModel;
import com.yihu.ehr.apps.service.AppClient;
import com.yihu.ehr.constants.AgAdminConstants;
import com.yihu.ehr.constants.ApiVersion;
import com.yihu.ehr.constants.ServiceApi;
import com.yihu.ehr.controller.BaseController;
import com.yihu.ehr.fileresource.service.FileResourceClient;
import com.yihu.ehr.geography.service.AddressClient;
import com.yihu.ehr.model.adaption.MAdapterOrg;
import com.yihu.ehr.model.adaption.MAdapterPlan;
import com.yihu.ehr.model.app.MApp;
import com.yihu.ehr.model.common.ObjectResult;
import com.yihu.ehr.model.dict.MConventionalDict;
import com.yihu.ehr.model.geography.MGeography;
import com.yihu.ehr.model.geography.MGeographyDict;
import com.yihu.ehr.model.org.MOrganization;
import com.yihu.ehr.model.security.MKey;
import com.yihu.ehr.model.user.MUser;
import com.yihu.ehr.organization.model.KeyModel;
import com.yihu.ehr.organization.service.OrganizationClient;
import com.yihu.ehr.redis.client.RedisUpdateClient;
import com.yihu.ehr.security.service.SecurityClient;
import com.yihu.ehr.systemdict.service.ConventionalDictEntryClient;
import com.yihu.ehr.template.service.TemplateClient;
import com.yihu.ehr.users.service.UserClient;
import com.yihu.ehr.util.datetime.DateUtil;
import com.yihu.ehr.util.fzgateway.FzGatewayUtil;
import com.yihu.ehr.util.rest.Envelop;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.*;
/**
 * Created by AndyCai on 2016/1/21.
 */
@RequestMapping(ApiVersion.Version1_0 + "/organizations" )
@RestController
@Api(value = "OrganizationController", description = "机构开放管理", tags = {"机构开放管理 - 机构信息开放管理"})
public class OrganizationOpenController extends BaseController {
    @Autowired
    private SecurityClient securityClient;
    @RequestMapping(value = "/{org_code}/key", method = RequestMethod.GET)
    @ApiOperation(value = "获取机构公钥", notes = "机构公钥")
    public KeyModel getPublicKey(
            @ApiParam(name = "org_code", value = "机构代码")
            @PathVariable(value = "org_code")
                    String orgCode) {
        MKey key = securityClient.getOrgKey(orgCode);
        KeyModel model = new KeyModel();
        BeanUtils.copyProperties(key, model, "privateKey","fromDate","expiryDate");
        return model;
    }
}