package com.product.saas.controller; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.product.admin.config.SystemCode; import com.product.saas.config.SaasConst; import com.product.saas.service.SystemContractService; import com.product.core.controller.support.AbstractBaseController; import com.product.core.entity.FieldSetEntity; import com.product.core.exception.BaseException; import com.product.module.sys.version.ApiVersion; import com.product.util.BaseUtil; @RequestMapping("/api/system-contract") @RestController public class SystemContractController extends AbstractBaseController{ @Autowired SystemContractService systemContractService; /** * 获取租户最新合同信息 * @param request * @return */ @RequestMapping("/find-contract/{version}") @ApiVersion(1) public String findContract(HttpServletRequest request){ try { FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, SaasConst.PRODUCT_SYS_CONTRACT); return OK_List(systemContractService.findContract(fse.getString("uuid"))); } catch (BaseException e) { e.printStackTrace(); return this.error(e); }catch (Exception e){ e.printStackTrace(); return error(SystemCode.GET_FUNCTION_TREE_FAIL.getValue(),SystemCode.GET_FUNCTION_TREE_FAIL.getText()+e.getMessage()); } } }