zoukankan      html  css  js  c++  java
  • springData controller示例

    package com.guohuai.mmp.investor.bankcard;

    import javax.servlet.http.HttpServletRequest;
    import javax.validation.Valid;

    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.data.domain.Page;
    import org.springframework.data.domain.PageRequest;
    import org.springframework.data.domain.Pageable;
    import org.springframework.data.domain.Sort;
    import org.springframework.data.domain.Sort.Direction;
    import org.springframework.data.domain.Sort.Order;
    import org.springframework.http.HttpStatus;
    import org.springframework.http.ResponseEntity;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestMethod;
    import org.springframework.web.bind.annotation.RequestParam;
    import org.springframework.web.bind.annotation.ResponseBody;
    import org.springframework.web.bind.annotation.RestController;

    import com.guohuai.basic.component.ext.web.BaseController;
    import com.guohuai.basic.component.ext.web.BaseResp;
    import com.guohuai.component.util.DateUtil;
    import com.guohuai.component.util.DesPlus;
    import com.guohuai.component.util.StringUtil;
    import com.guohuai.mmp.investor.bank.BankEntity;
    import com.guohuai.mmp.investor.bank.BankInfoRep;
    import com.guohuai.mmp.platform.KickStarUitl;

    @RestController
    @RequestMapping(value = "/mimosa/investorBankCard", produces = "application/json")
    public class InvestorBankCardController extends BaseController{

    @Autowired
    private InvestorBankCardService investorBankCardService;

    /**
    *
    */
    @RequestMapping(value = "smng", method = RequestMethod.POST)
    @ResponseBody
    public ResponseEntity<InvestorBankCardListResp> smng(HttpServletRequest request,
    @RequestParam int page,
    @RequestParam int rows,
    @RequestParam String investorOid,
    @RequestParam(required = false, defaultValue = "createTime") String sort,
    @RequestParam(required = false, defaultValue = "desc") String order) {
    Direction sortDirection = Direction.DESC;

    Pageable pageable = new PageRequest(page - 1, rows, new Sort(new Order(sortDirection, sort)));


    Page<InvestorBankCardQueryEntity> formEntity = investorBankCardService.getInvestorBankCardFormData(investorOid, pageable);
    InvestorBankCardListResp formListResp = new InvestorBankCardListResp(formEntity);
    return new ResponseEntity<InvestorBankCardListResp>(formListResp, HttpStatus.OK);
    }

    /**
    * 企业银行卡--解绑
    * lize
    */
    @RequestMapping(value = "investorBindCardRelease", method = RequestMethod.POST)
    @ResponseBody
    public ResponseEntity<BaseResp> investorBindCardRelease (@RequestParam String investorOid) {
    BaseResp rep = this.investorBankCardService.investorReleaseCard( investorOid);
    return new ResponseEntity<BaseResp>(rep, HttpStatus.OK);
    }



    /**
    * 企业银行卡--换卡
    * lize
    */
    @RequestMapping(value = "investorBindCardChange", method = RequestMethod.POST)
    @ResponseBody
    public ResponseEntity<BaseResp> investorBindCardChange(@Valid InvestorGroupBindCardEntity req) {
    BaseResp rep = this.investorBankCardService.investorChangeCard(req);
    return new ResponseEntity<BaseResp>(rep, HttpStatus.OK);
    }


    /**
    * 企业银行卡--绑卡
    * lize
    */
    @RequestMapping(value = "investorBindCardBind", method = RequestMethod.POST)
    @ResponseBody
    public ResponseEntity<BaseResp> investorBindCardBind(@Valid InvestorGroupBindCardEntity req) {

    BaseResp rep = this.investorBankCardService.investorBindCard(req);
    return new ResponseEntity<BaseResp>(rep, HttpStatus.OK);
    }


    /**
    * 企业银行卡--换绑卡审核
    * lize
    */
    @RequestMapping(value = "ChangeAndBindCardAudit", method = RequestMethod.POST)
    @ResponseBody
    public ResponseEntity<BaseResp> ChangeAndBindCardAudit(@RequestParam String oid,
    @RequestParam String isPass,
    @RequestParam String auditAnno) {

    BaseResp rep =this.investorBankCardService.ChangeAndBindCardAudit(oid,isPass,auditAnno);
    return new ResponseEntity<BaseResp>(rep, HttpStatus.OK);
    }

    /**
    * 解卡,换绑卡,是否允许
    */
    @RequestMapping(value = "checkInvestorBinkOrUnlockStatus", method = RequestMethod.POST)
    @ResponseBody
    public ResponseEntity<String> checkInvestorBinkOrUnlockStatus(@RequestParam String investorOid) {
    boolean checkFlag = this.investorBankCardService.checkInvestorBinkOrUnlockStatus(investorOid);
    return new ResponseEntity<String>(String.valueOf(checkFlag), HttpStatus.OK);
    }




    }

  • 相关阅读:
    如何只通过Sandboxed Solution启动一个定时执行的操作
    创建与SharePoint 2010风格一致的下拉菜单 (续) 整合Feature Custom Action框架
    创建与SharePoint 2010风格一致的下拉菜单
    《SharePoint 2010 应用程序开发指南》第二章预览
    SharePoint 2013 App 开发 (1) 什么是SharePoint App?
    使用Jscex增强SharePoint 2010 JavaScript Client Object Model (JSOM)
    搜索范围的管理
    SharePoint 2010 服务应用程序(Service Application)架构(1)
    SharePoint 2010 服务应用程序(Service Application)架构(2)
    SharePoint 2013 App 开发 (2) 建立开发环境
  • 原文地址:https://www.cnblogs.com/lize1215/p/8482331.html
Copyright © 2011-2022 走看看