# zowork-cloud-sdk **Repository Path**: zowork/zowork-cloud-sdk ## Basic Information - **Project Name**: zowork-cloud-sdk - **Description**: 访问zowork cloud的sdk java封装 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-03-27 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #sdk开发介绍 1. 定义输入输出模型 ####输入Param模型#### ```` public class CreateNewsParam extends BaseRemoteParam { /** * 主键id */ Long id; /** * 类别主键id */ @NotEmpty Long cateId; ....... } ```` ####返回Model#### ```` public class CreateNewsModel extends BaseModel { /** * 主键id */ Long id; /** * 类别主键id */ Long cateId; /** * 作者 */ String author; /** * 新闻标题 */ String title; ....... } ```` 2. 定义一个Service的方法 ```` public interface RemoteNewsService { @ApiConfig(host = Constants.host, value = "news/create", serializer = JsonSerializer.class, httpMethod = HttpMethod.POST) Result create(CreateNewsParam createParam); @ApiConfig(host = Constants.host, value = "news/list_channel", serializer = JsonSerializer.class, httpMethod = HttpMethod.POST) Result> listChannel(ListChannelNewsParam param); } ```` 2. 配置ApiConfig注解 ```` @ApiConfig(host = Constants.host, value = "news/create", serializer = JsonSerializer.class, httpMethod = HttpMethod.POST) ```` 4. 通过ApiFactory获取Service实例 ```` RemoteNewsService newsService=ApiFactory.getService(RemoteNewsService.class); ````