예제 #1
0
 public static IPromise <Res.Protest> GetById(string id)
 {
     return(get <Res.ProtestResponse>("/protests/" + id)
            .Then(res =>
     {
         GraphMap g = new GraphMap(res.graph);
         return g.Protest(res.protest);
     }));
 }
예제 #2
0
 public static IPromise <Res.Protest> CreateProtest(
     uint placeId,
     uint protestTypeId,
     string userAvatarId,
     string bannerId,
     List <string> bannerWords,
     uint duration)
 {
     Req.CreateProtest req = new Req.CreateProtest
     {
         placeId       = placeId,
         protestTypeId = protestTypeId,
         userAvatarId  = userAvatarId,
         bannerId      = bannerId,
         bannerWords   = bannerWords,
         duration      = duration
     };
     return(post <Res.ProtestResponse>("/protests", req)
            .Then(res =>
     {
         GraphMap g = new GraphMap(res.graph);
         return g.Protest(res.protest);
     }));
 }