|
|
@@ -6,6 +6,7 @@ import com.jfinal.plugin.activerecord.Record;
|
|
|
import common.interceptor.empty.EmptyInterface;
|
|
|
import common.model.Address;
|
|
|
import common.model.Token;
|
|
|
+import common.model.V3Lp;
|
|
|
import common.utils.http.MyController;
|
|
|
import common.utils.http.MyPaginate;
|
|
|
import common.utils.http.MyRet;
|
|
|
@@ -35,6 +36,30 @@ public class TokenController extends MyController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @EmptyInterface(keyArray = {"chainId", "hash"})
|
|
|
+ public void append() {
|
|
|
+ Token token = getJsonModel(Token.class);
|
|
|
+ Address address = AddressFactory.parseAddress(token);
|
|
|
+
|
|
|
+ boolean code = service.append(token, address);
|
|
|
+ if (code) {
|
|
|
+ renderJson(MyRet.ok("Save v3 lp successful.").setData(token));
|
|
|
+ } else {
|
|
|
+ renderJson(MyRet.fail("Save v3 lp fail.").setData(address));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @EmptyInterface(keyArray = {"chainId", "hash"})
|
|
|
+ public void update() {
|
|
|
+ Token token = getJsonModel(Token.class);
|
|
|
+ boolean code = service.update(token);
|
|
|
+ if (code) {
|
|
|
+ renderJson(MyRet.ok("update v3 lp successful.").setData(token));
|
|
|
+ } else {
|
|
|
+ renderJson(MyRet.fail("update v3 lp fail.").setData(token));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@EmptyInterface(keyArray = {"chainId", "hash"})
|
|
|
public void findByChainIdAndHash() {
|
|
|
Token token = getJsonModel(Token.class);
|