Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rocherkong/coremessage

Easy Request/Response Message For Http.
https://github.com/rocherkong/coremessage

Last synced: 5 days ago
JSON representation

Easy Request/Response Message For Http.

Awesome Lists containing this project

README

        

## CoreMessage
# Request
- RequestMessage
- GetByIdRequest
- GetByIdRequest<T>
- IdRequest
- IdRequest<T>
- NoneRequest
- QueryByPageRequest

# Response
- ResponseMessage
- QueryResponse<TItem>
- QueryByPageResponse
- QueryByPageResponse<TItem>
- GetByIdResponse<T>
- ResponseMessageWrap<T>

```c#
* Use Bara ORM
[HttpPost]
public ResponseMessageWrap> Query([FromBody]QueryRequest reqMsg)
{
var list = baraMapper.Query(new Bara.Core.Context.RequestContext
{
Request = reqMsg,
Scope = "B_Book",
SqlId = "QueryListByPage"
});

var record = baraMapper.ExecuteScalar(new Bara.Core.Context.RequestContext
{
Request = reqMsg,
Scope = "B_Book",
SqlId = "GetRecord"
});

return new ResponseMessageWrap>
{
Body = new GetByPageResponse
{
List = list,
TotalRecord = record
}
};
}
```

```json
Request Parameters
{
"PageIndex": 0,
"PageSize": 0,
"Header": {
"Operator": 0,
"IP": "string"
}
}

Response body
{
"IsSuccess": true,
"ErrorCode": "00000",
"Message": null,
"Body": {
"TotalRecord": 0,
"List": []
}
}

```