4.5 KiB
4.5 KiB
appapi/appfollower (信眾管理)
[RoutePrefix("api/appfollower")]
public class appFollowerController : ApiController
Get()
介面
public IEnumerable<Model.follower> Get()
取得所有信眾資料列表
傳回
IEnumerable<Model.follower>
介面
public IEnumerable<Model.follower> Get
(int page, int pageSize = 10,
string sortBy="", bool sortDesc=false)
取得指定分頁信眾資料列表
傳回
IEnumerable<Model.follower>
介面
// GET appapi/<controller>/5
public Model.follower Get(int id)
依ID取得指定單筆信眾
傳回
Model.follower
Post()
介面
// POST appapi/<controller>
public void Post([FromBody] Model.follower item)
新增信眾
傳回
Put()
介面
// PUT appapi/<controller>/5
public void Put(int id, [FromBody] Model.follower item)
修改信眾
傳回
Delete()
介面
// DELETE appapi/<controller>/5
public void Delete(int id)
刪除指定ID信眾
傳回
[HttpDelete] api/appfollower/Delete/{nums}
介面
[HttpDelete]
[Route("api/appfollower/Delete/{nums}")]
public void Delete(string nums)
刪除指定信眾編號信眾
傳回
[HttpGet] api/appfollower/count
介面
[HttpGet]
[Route("api/appfollower/count")]
public int Count()
傳回筆數
傳回
int
[HttpPost] api/appfollower/GetList
介面
[HttpPost]
[Route("api/appfollower/GetList")]
public IHttpActionResult GetList(
[FromBody] Model.ViewModel.follower q,
int page, int pageSize = 10,
string sortBy = "", bool sortDesc = false)
對信眾資料:分頁查詢, 排序, 傳回列表
傳回
{
list = IEnumerable<Model.follower>, //分頁列表
count = int //筆數
}
[HttpPost] api/appfollower/GetTabletList
介面
[HttpPost]
[Route("api/appfollower/GetTabletList")]
public IHttpActionResult GetTabletList([FromBody] Model.follower q,
int page, int pageSize = 10,
string sortBy = "", bool sortDesc = false)
取得牌位資訊
傳回
List of: new
{
id = i++,
num = x.num,
f_num = x.f_num,
type = x.type, //型式
title = x.title, //標題
})
[HttpPost] api/appfollower/tabletSave
介面
[HttpPost]
[Route("api/appfollower/tabletSave")]
public IHttpActionResult tabletSave([FromBody] Model.ViewModel.followers_tablet item)
儲存牌位資訊
傳回
int //牌位編號
[HttpDelete] api/appfollower/tabletDelete/{id}
介面
[HttpDelete]
[Route("api/appfollower/tabletDelete/{id}")]
public void tabletDelete(int id)
刪除牌位資訊
傳回
[HttpPost] CheckHashFollower
介面
[HttpPost]
[Route("api/appfollower/checkHashFollower")]
public IHttpActionResult CheckHashFollower([FromBody] Model.ViewModel.follower q)
取得用戶資訊
傳回
例:
Request:
curl --location 'http://<SERVER_URL>/api/appfollower/checkHashFollower' \
--header 'Content-Type: application/json' \
--data '{
"phone":"0987456321",
"id_code":"A123456789"
}'
Response:
JSON: 用戶資訊, 可討論只要哪些欄位