entity_appinfo.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. function data_get_appinfo( id ) {
  2. var query_url = '../jaxrs/appinfo/' + id;
  3. //如果未输入ID,那么就查询所有的应用信息
  4. if( id == null || id == undefined || id == "" ){
  5. query_url = '../jaxrs/appinfo/list/all';
  6. }
  7. $.ajax({
  8. type : 'get',
  9. dataType : 'json',
  10. contentType : 'application/json; charset=utf-8',
  11. url : query_url,
  12. xhrFields : {
  13. 'withCredentials' : true
  14. },
  15. crossDomain : true
  16. }).done(function(json) {
  17. $('#result').html( JSON.stringify( json, null, 4) );
  18. }).fail(function(json) {
  19. failure(json);
  20. });
  21. }
  22. function data_getforuser_appinfo( ) {
  23. var query_url = '../jaxrs/appinfo/list/user';
  24. $.ajax({
  25. type : 'get',
  26. dataType : 'json',
  27. contentType : 'application/json; charset=utf-8',
  28. url : query_url,
  29. xhrFields : {
  30. 'withCredentials' : true
  31. },
  32. crossDomain : true
  33. }).done(function(json) {
  34. $('#result').html( JSON.stringify( json, null, 4) );
  35. }).fail(function(json) {
  36. failure(json);
  37. });
  38. }
  39. function data_geticon_appinfo( id ) {
  40. var query_url = '../jaxrs/appinfo/' + id + "/icon";
  41. if( id == null || id == undefined || id == "" ){
  42. alert("请输入ID");
  43. return false;
  44. }
  45. $.ajax({
  46. type : 'get',
  47. dataType : 'json',
  48. contentType : 'application/json; charset=utf-8',
  49. url : query_url,
  50. xhrFields : {
  51. 'withCredentials' : true
  52. },
  53. crossDomain : true
  54. }).done(function(json) {
  55. $('#result').html( JSON.stringify( json, null, 4) );
  56. }).fail(function(json) {
  57. failure(json);
  58. });
  59. }
  60. function data_put_appinfo( id ) {
  61. if( id == null || id == undefined || id == "" ){
  62. alert("请输入ID");
  63. return false;
  64. }
  65. $.ajax({
  66. type : 'put',
  67. dataType : 'json',
  68. contentType : 'application/json; charset=utf-8',
  69. url : '../jaxrs/appinfo/' + id,
  70. xhrFields : {
  71. 'withCredentials' : true
  72. },
  73. data : JSON.stringify($.parseJSON($('#content').val())),
  74. crossDomain : true
  75. }).done(function(json) {
  76. $('#result').html(JSON.stringify(json.data, null, 4));
  77. });
  78. }
  79. function data_post_appinfo( id ) {
  80. $.ajax({
  81. type : 'post',
  82. dataType : 'json',
  83. contentType : 'application/json; charset=utf-8',
  84. url : '../jaxrs/appinfo' ,
  85. xhrFields : {
  86. 'withCredentials' : true
  87. },
  88. data : JSON.stringify($.parseJSON($('#content').val())),
  89. crossDomain : true
  90. }).done(function(json) {
  91. $('#result').html(JSON.stringify(json.data, null, 4));
  92. });
  93. }
  94. function data_delete_appinfo( id ) {
  95. if( id == null || id == undefined || id == "" ){
  96. alert("请输入ID");
  97. return false;
  98. }
  99. $.ajax({
  100. type : 'delete',
  101. dataType : 'json',
  102. contentType : 'application/json; charset=utf-8',
  103. url : '../jaxrs/appinfo/' + id ,
  104. xhrFields : {
  105. 'withCredentials' : true
  106. },
  107. crossDomain : true
  108. }).done(function(json) {
  109. $('#result').html(JSON.stringify(json.data, null, 4));
  110. });
  111. }