55 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
		
		
			
		
	
	
			55 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								using System.Collections.Generic;
							 | 
						|||
| 
								 | 
							
								using System.Linq;
							 | 
						|||
| 
								 | 
							
								using System.Threading.Tasks;
							 | 
						|||
| 
								 | 
							
								using Microsoft.AspNetCore.Authorization;
							 | 
						|||
| 
								 | 
							
								using Microsoft.AspNetCore.Mvc;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace APT.BD.WebApi.Controllers.Api
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    [Route("api/[controller]")]
							 | 
						|||
| 
								 | 
							
								    [ApiController]
							 | 
						|||
| 
								 | 
							
								    public class ValuesController : Controller
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        [HttpGet]
							 | 
						|||
| 
								 | 
							
								        public ActionResult<IEnumerable<string>> Get()
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            return new string[] { "RELEASE", "Version2020-04-1:2048" };
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        // GET api/values/5
							 | 
						|||
| 
								 | 
							
								        [Authorize]
							 | 
						|||
| 
								 | 
							
								        [HttpPost("{id}")]
							 | 
						|||
| 
								 | 
							
								        public ActionResult<string> Get(int id)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            return "value";
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        // POST api/values
							 | 
						|||
| 
								 | 
							
								        [HttpPost]
							 | 
						|||
| 
								 | 
							
								        public void Post([FromBody] string value)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            //if (value is { Length: > 0 })
							 | 
						|||
| 
								 | 
							
								            //{
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            //}
							 | 
						|||
| 
								 | 
							
								            //if (value is "a" or "b")
							 | 
						|||
| 
								 | 
							
								            //{
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            //}
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        // PUT api/values/5
							 | 
						|||
| 
								 | 
							
								        [HttpPut("{id}")]
							 | 
						|||
| 
								 | 
							
								        public void Put(int id, [FromBody] string value)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        // DELETE api/values/5
							 | 
						|||
| 
								 | 
							
								        [HttpDelete("{id}")]
							 | 
						|||
| 
								 | 
							
								        public void Delete(int id)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |