Commit 6083ac6d by s_guodong

整合Jersey

parent cc45a34b
...@@ -76,6 +76,10 @@ ...@@ -76,6 +76,10 @@
<artifactId>commons-compress</artifactId> <artifactId>commons-compress</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jersey</artifactId>
</dependency>
<dependency>
<groupId>com.brilliance</groupId> <groupId>com.brilliance</groupId>
<artifactId>jrxx-bean</artifactId> <artifactId>jrxx-bean</artifactId>
<version>0.0.1</version> <version>0.0.1</version>
......
package com.ceb.gjjs.mda.config;
import org.glassfish.jersey.server.ResourceConfig;
import org.springframework.stereotype.Component;
import javax.ws.rs.ApplicationPath;
/**
* @Description
* @Author s_guodong
* @Date 2023/6/20
*/
@Component
@ApplicationPath("/gjjs/business")
public class JerseyConfig extends ResourceConfig {
public JerseyConfig() {
packages("com.ceb.gjjs.mda.resource");
}
}
...@@ -3,10 +3,12 @@ package com.ceb.gjjs.mda.resource; ...@@ -3,10 +3,12 @@ package com.ceb.gjjs.mda.resource;
import com.brilliance.mda.runtime.request.BaseVO; import com.brilliance.mda.runtime.request.BaseVO;
import com.brilliance.mda.runtime.response.ResponseSet; import com.brilliance.mda.runtime.response.ResponseSet;
import com.ceb.gjjs.mda.service.ICommonService; import com.ceb.gjjs.mda.service.ICommonService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
/** /**
* @author wangguangchao * @author wangguangchao
* @create 2021-09-24 11:51 * @create 2021-09-24 11:51
...@@ -15,65 +17,73 @@ public abstract class AbstractCommonResource<V extends BaseVO> { ...@@ -15,65 +17,73 @@ public abstract class AbstractCommonResource<V extends BaseVO> {
protected abstract ICommonService getCommonService(); protected abstract ICommonService getCommonService();
@PostMapping("/init") @Path("/init")
@POST
public ResponseSet<V> init(@RequestBody V req) { public ResponseSet<V> init(@RequestBody V req) {
return getCommonService().init(req); return getCommonService().init(req);
} }
@PostMapping("/checkAll") @Path("/checkAll")
@POST
public ResponseSet checkAll(@RequestBody V req) { public ResponseSet checkAll(@RequestBody V req) {
return getCommonService().checkAll(req); return getCommonService().checkAll(req);
} }
@PostMapping("/saveData")
public ResponseSet<V> saveData(@RequestBody V req) {
@Path("/saveData")
@POST
public ResponseSet<V> saveData(@RequestBody V req) {
return getCommonService().saveData(req); return getCommonService().saveData(req);
} }
@PostMapping("/confirmData") @Path("/confirmData")
@POST
public ResponseSet<V> confirmData(@RequestBody V req) { public ResponseSet<V> confirmData(@RequestBody V req) {
return getCommonService().confirmData(req); return getCommonService().confirmData(req);
} }
@PostMapping("/pending") @Path("/pending")
@POST
public ResponseSet<V> pending(@RequestBody V req) { public ResponseSet<V> pending(@RequestBody V req) {
return getCommonService().pending(req); return getCommonService().pending(req);
} }
@PostMapping("/executeCheck/{rule}") @Path("/executeCheck/{rule}")
public ResponseSet<V> executeCheck(@PathVariable("rule") String rule, @RequestBody V req) { @POST
public ResponseSet<V> executeCheck(@PathParam("rule") String rule, @RequestBody V req) {
String[] ruleArr = rule.split(","); String[] ruleArr = rule.split(",");
return getCommonService().executeCheck(req,ruleArr); return getCommonService().executeCheck(req, ruleArr);
} }
@PostMapping("/executeRule/{rule}") @Path("/executeRule/{rule}")
public ResponseSet<V> executeRule(@PathVariable("rule") String rule,@RequestBody V req) { @POST
public ResponseSet<V> executeRule(@PathParam("rule") String rule, @RequestBody V req) {
String[] ruleArr = rule.split(","); String[] ruleArr = rule.split(",");
ResponseSet<V> res = getCommonService().executeRule(req,ruleArr); ResponseSet<V> res = getCommonService().executeRule(req, ruleArr);
return res; return res;
} }
@PostMapping("/executeDefault/{rule}") @Path("/executeDefault/{rule}")
public ResponseSet<V> executeDefault(@PathVariable("rule") String rule,@RequestBody V req) { @POST
public ResponseSet<V> executeDefault(@PathParam("rule") String rule, @RequestBody V req) {
String[] ruleArr = rule.split(","); String[] ruleArr = rule.split(",");
return getCommonService().executeDefault(req,ruleArr); return getCommonService().executeDefault(req, ruleArr);
} }
@PostMapping("/executeNotify") @Path("/executeNotify")
@POST
public ResponseSet<V> executeNotify(@RequestBody V req) { public ResponseSet<V> executeNotify(@RequestBody V req) {
return getCommonService().executeNotify(req); return getCommonService().executeNotify(req);
} }
@PostMapping("/executeDocpan") @Path("/executeDocpan")
@POST
public ResponseSet<V> executeDocpan(@RequestBody V req) { public ResponseSet<V> executeDocpan(@RequestBody V req) {
return getCommonService().executeDocpan(req); return getCommonService().executeDocpan(req);
} }
@PostMapping("/executeDocpanDetail") @Path("/executeDocpanDetail")
@POST
public ResponseSet<V> executeDocpanDetail(@RequestBody V req) { public ResponseSet<V> executeDocpanDetail(@RequestBody V req) {
return getCommonService().executeDocpanDetail(req); return getCommonService().executeDocpanDetail(req);
} }
......
server: server:
port: 8088 port: 8088
servlet: servlet:
context-path: /gjjs/business #context-path: /gjjs/business
servlet-path : /gjjs/business
spring: spring:
ipsnew: ipsnew:
driver-class-name: oracle.jdbc.driver.OracleDriver driver-class-name: oracle.jdbc.driver.OracleDriver
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment