Pre Merge pull request !2 from reset/master

pull/2/MERGE
reset 3 years ago committed by Gitee
commit 77da9a1bfe
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -0,0 +1,15 @@
package com.engine.organization.service;
import com.engine.organization.entity.po.Demo;
/**
* @Author weaver_cl
* @Description: TODO
* @Date 2022/4/28
* @Version V1.0
**/
public interface TestService {
Demo list(String name);
}

@ -11,6 +11,7 @@ import com.engine.organization.util.HrmI18nUtil;
import com.engine.organization.util.LogAspect; import com.engine.organization.util.LogAspect;
import com.engine.organization.util.OrganizationAssert; import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
import com.weaverboot.frame.ioc.anno.classAnno.WeaIocService;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.List; import java.util.List;
@ -21,6 +22,7 @@ import java.util.List;
* @Date 2022/4/27 * @Date 2022/4/27
* @Version V1.0 * @Version V1.0
**/ **/
@WeaIocService
public class DemoServiceImpl extends Service implements DemoService { public class DemoServiceImpl extends Service implements DemoService {

@ -0,0 +1,20 @@
package com.engine.organization.service.impl;
import com.engine.organization.entity.po.Demo;
import com.engine.organization.service.TestService;
import com.weaverboot.frame.ioc.anno.classAnno.WeaIocService;
/**
* @Author weaver_cl
* @Description: TODO
* @Date 2022/4/28
* @Version V1.0
**/
@WeaIocService
public class TestServiceImpl implements TestService {
@Override
public Demo list(String name) {
return Demo.builder().fid(1).build();
}
}

@ -1,8 +1,11 @@
package com.engine.organization.web; package com.engine.organization.web;
import com.engine.common.util.ServiceUtil; import com.engine.common.util.ServiceUtil;
import com.engine.organization.entity.po.Demo;
import com.engine.organization.service.TestService;
import com.engine.organization.util.response.ReturnResult; import com.engine.organization.util.response.ReturnResult;
import com.engine.organization.wrapper.DemoWrapper; import com.engine.organization.wrapper.DemoWrapper;
import com.weaverboot.frame.ioc.anno.fieldAnno.WeaAutowired;
import weaver.hrm.HrmUserVarify; import weaver.hrm.HrmUserVarify;
import weaver.hrm.User; import weaver.hrm.User;
@ -14,6 +17,7 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam; import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context; import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import java.util.List;
/** /**
* @Author weaver_cl * @Author weaver_cl
@ -40,4 +44,25 @@ public class DemoController {
} }
} }
/**
* 2 weaverboot 使
*/
@WeaAutowired
private TestService testService;
@GET
@Path("/get")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult testGet(@Context HttpServletRequest request, @Context HttpServletResponse response,
@QueryParam("name") String name) {
try {
Demo list = testService.list(name);
return ReturnResult.successed(list);
}catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
} }

Loading…
Cancel
Save