entity_appinfo.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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_getforadmin_appinfo( ) {
  23. var query_url = '../jaxrs/appinfo/list/admin';
  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_getforuser_appinfo( ) {
  40. var query_url = '../jaxrs/appinfo/list/user';
  41. $.ajax({
  42. type : 'get',
  43. dataType : 'json',
  44. contentType : 'application/json; charset=utf-8',
  45. url : query_url,
  46. xhrFields : {
  47. 'withCredentials' : true
  48. },
  49. crossDomain : true
  50. }).done(function(json) {
  51. $('#result').html( JSON.stringify( json, null, 4) );
  52. }).fail(function(json) {
  53. failure(json);
  54. });
  55. }
  56. function data_geticon_appinfo( id ) {
  57. var query_url = '../jaxrs/appinfo/' + id + "/icon";
  58. if( id == null || id == undefined || id == "" ){
  59. alert("请输入ID");
  60. return false;
  61. }
  62. $.ajax({
  63. type : 'get',
  64. dataType : 'json',
  65. contentType : 'application/json; charset=utf-8',
  66. url : query_url,
  67. xhrFields : {
  68. 'withCredentials' : true
  69. },
  70. crossDomain : true
  71. }).done(function(json) {
  72. $('#result').html( JSON.stringify( json, null, 4) );
  73. }).fail(function(json) {
  74. failure(json);
  75. });
  76. }
  77. function data_put_appinfo( id ) {
  78. if( id == null || id == undefined || id == "" ){
  79. alert("请输入ID");
  80. return false;
  81. }
  82. $.ajax({
  83. type : 'put',
  84. dataType : 'json',
  85. contentType : 'application/json; charset=utf-8',
  86. url : '../jaxrs/appinfo/' + id,
  87. xhrFields : {
  88. 'withCredentials' : true
  89. },
  90. data : JSON.stringify($.parseJSON($('#content').val())),
  91. crossDomain : true
  92. }).done(function(json) {
  93. $('#result').html(JSON.stringify(json.data, null, 4));
  94. });
  95. }
  96. function data_post_appinfo( id ) {
  97. $.ajax({
  98. type : 'post',
  99. dataType : 'json',
  100. contentType : 'application/json; charset=utf-8',
  101. url : '../jaxrs/appinfo' ,
  102. xhrFields : {
  103. 'withCredentials' : true
  104. },
  105. data : JSON.stringify($.parseJSON($('#content').val())),
  106. crossDomain : true
  107. }).done(function(json) {
  108. $('#result').html(JSON.stringify(json.data, null, 4));
  109. });
  110. }
  111. function data_delete_appinfo( id ) {
  112. if( id == null || id == undefined || id == "" ){
  113. alert("请输入ID");
  114. return false;
  115. }
  116. $.ajax({
  117. type : 'delete',
  118. dataType : 'json',
  119. contentType : 'application/json; charset=utf-8',
  120. url : '../jaxrs/appinfo/' + id ,
  121. xhrFields : {
  122. 'withCredentials' : true
  123. },
  124. crossDomain : true
  125. }).done(function(json) {
  126. $('#result').html(JSON.stringify(json.data, null, 4));
  127. });
  128. }